1 /*********************************************************************** 2 * Software License Agreement (BSD License) 3 * 4 * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 *************************************************************************/ 28 29 30 #ifndef OPENCV_FLANN_DEFINES_H_ 31 #define OPENCV_FLANN_DEFINES_H_ 32 33 //! @cond IGNORED 34 35 #include "config.h" 36 37 #ifdef FLANN_EXPORT 38 #undef FLANN_EXPORT 39 #endif 40 #ifdef _WIN32 41 /* win32 dll export/import directives */ 42 #ifdef FLANN_EXPORTS 43 #define FLANN_EXPORT __declspec(dllexport) 44 #elif defined(FLANN_STATIC) 45 #define FLANN_EXPORT 46 #else 47 #define FLANN_EXPORT __declspec(dllimport) 48 #endif 49 #else 50 /* unix needs nothing */ 51 #define FLANN_EXPORT 52 #endif 53 54 55 #undef FLANN_PLATFORM_32_BIT 56 #undef FLANN_PLATFORM_64_BIT 57 #if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64 58 #define FLANN_PLATFORM_64_BIT 59 #else 60 #define FLANN_PLATFORM_32_BIT 61 #endif 62 63 64 #undef FLANN_ARRAY_LEN 65 #define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0])) 66 67 namespace cvflann { 68 69 /* Nearest neighbour index algorithms */ 70 enum flann_algorithm_t 71 { 72 FLANN_INDEX_LINEAR = 0, 73 FLANN_INDEX_KDTREE = 1, 74 FLANN_INDEX_KMEANS = 2, 75 FLANN_INDEX_COMPOSITE = 3, 76 FLANN_INDEX_KDTREE_SINGLE = 4, 77 FLANN_INDEX_HIERARCHICAL = 5, 78 FLANN_INDEX_LSH = 6, 79 FLANN_INDEX_SAVED = 254, 80 FLANN_INDEX_AUTOTUNED = 255, 81 82 // deprecated constants, should use the FLANN_INDEX_* ones instead 83 LINEAR = 0, 84 KDTREE = 1, 85 KMEANS = 2, 86 COMPOSITE = 3, 87 KDTREE_SINGLE = 4, 88 SAVED = 254, 89 AUTOTUNED = 255 90 }; 91 92 93 94 enum flann_centers_init_t 95 { 96 FLANN_CENTERS_RANDOM = 0, 97 FLANN_CENTERS_GONZALES = 1, 98 FLANN_CENTERS_KMEANSPP = 2, 99 FLANN_CENTERS_GROUPWISE = 3, 100 101 // deprecated constants, should use the FLANN_CENTERS_* ones instead 102 CENTERS_RANDOM = 0, 103 CENTERS_GONZALES = 1, 104 CENTERS_KMEANSPP = 2 105 }; 106 107 enum flann_log_level_t 108 { 109 FLANN_LOG_NONE = 0, 110 FLANN_LOG_FATAL = 1, 111 FLANN_LOG_ERROR = 2, 112 FLANN_LOG_WARN = 3, 113 FLANN_LOG_INFO = 4 114 }; 115 116 enum flann_distance_t 117 { 118 FLANN_DIST_EUCLIDEAN = 1, 119 FLANN_DIST_L2 = 1, 120 FLANN_DIST_MANHATTAN = 2, 121 FLANN_DIST_L1 = 2, 122 FLANN_DIST_MINKOWSKI = 3, 123 FLANN_DIST_MAX = 4, 124 FLANN_DIST_HIST_INTERSECT = 5, 125 FLANN_DIST_HELLINGER = 6, 126 FLANN_DIST_CHI_SQUARE = 7, 127 FLANN_DIST_CS = 7, 128 FLANN_DIST_KULLBACK_LEIBLER = 8, 129 FLANN_DIST_KL = 8, 130 FLANN_DIST_HAMMING = 9, 131 FLANN_DIST_DNAMMING = 10, 132 133 // deprecated constants, should use the FLANN_DIST_* ones instead 134 EUCLIDEAN = 1, 135 MANHATTAN = 2, 136 MINKOWSKI = 3, 137 MAX_DIST = 4, 138 HIST_INTERSECT = 5, 139 HELLINGER = 6, 140 CS = 7, 141 KL = 8, 142 KULLBACK_LEIBLER = 8 143 }; 144 145 enum flann_datatype_t 146 { 147 FLANN_INT8 = 0, 148 FLANN_INT16 = 1, 149 FLANN_INT32 = 2, 150 FLANN_INT64 = 3, 151 FLANN_UINT8 = 4, 152 FLANN_UINT16 = 5, 153 FLANN_UINT32 = 6, 154 FLANN_UINT64 = 7, 155 FLANN_FLOAT32 = 8, 156 FLANN_FLOAT64 = 9 157 }; 158 159 enum 160 { 161 FLANN_CHECKS_UNLIMITED = -1, 162 FLANN_CHECKS_AUTOTUNED = -2 163 }; 164 165 } 166 167 //! @endcond 168 169 #endif /* OPENCV_FLANN_DEFINES_H_ */ 170