defines.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. #ifndef OPENCV_FLANN_DEFINES_H_
  29. #define OPENCV_FLANN_DEFINES_H_
  30. //! @cond IGNORED
  31. #include "config.h"
  32. #ifdef FLANN_EXPORT
  33. #undef FLANN_EXPORT
  34. #endif
  35. #ifdef _WIN32
  36. /* win32 dll export/import directives */
  37. #ifdef FLANN_EXPORTS
  38. #define FLANN_EXPORT __declspec(dllexport)
  39. #elif defined(FLANN_STATIC)
  40. #define FLANN_EXPORT
  41. #else
  42. #define FLANN_EXPORT __declspec(dllimport)
  43. #endif
  44. #else
  45. /* unix needs nothing */
  46. #define FLANN_EXPORT
  47. #endif
  48. #undef FLANN_PLATFORM_32_BIT
  49. #undef FLANN_PLATFORM_64_BIT
  50. #if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64
  51. #define FLANN_PLATFORM_64_BIT
  52. #else
  53. #define FLANN_PLATFORM_32_BIT
  54. #endif
  55. #undef FLANN_ARRAY_LEN
  56. #define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0]))
  57. namespace cvflann {
  58. /* Nearest neighbour index algorithms */
  59. enum flann_algorithm_t
  60. {
  61. FLANN_INDEX_LINEAR = 0,
  62. FLANN_INDEX_KDTREE = 1,
  63. FLANN_INDEX_KMEANS = 2,
  64. FLANN_INDEX_COMPOSITE = 3,
  65. FLANN_INDEX_KDTREE_SINGLE = 4,
  66. FLANN_INDEX_HIERARCHICAL = 5,
  67. FLANN_INDEX_LSH = 6,
  68. FLANN_INDEX_SAVED = 254,
  69. FLANN_INDEX_AUTOTUNED = 255,
  70. // deprecated constants, should use the FLANN_INDEX_* ones instead
  71. LINEAR = 0,
  72. KDTREE = 1,
  73. KMEANS = 2,
  74. COMPOSITE = 3,
  75. KDTREE_SINGLE = 4,
  76. SAVED = 254,
  77. AUTOTUNED = 255
  78. };
  79. enum flann_centers_init_t
  80. {
  81. FLANN_CENTERS_RANDOM = 0,
  82. FLANN_CENTERS_GONZALES = 1,
  83. FLANN_CENTERS_KMEANSPP = 2,
  84. FLANN_CENTERS_GROUPWISE = 3,
  85. // deprecated constants, should use the FLANN_CENTERS_* ones instead
  86. CENTERS_RANDOM = 0,
  87. CENTERS_GONZALES = 1,
  88. CENTERS_KMEANSPP = 2
  89. };
  90. enum flann_log_level_t
  91. {
  92. FLANN_LOG_NONE = 0,
  93. FLANN_LOG_FATAL = 1,
  94. FLANN_LOG_ERROR = 2,
  95. FLANN_LOG_WARN = 3,
  96. FLANN_LOG_INFO = 4
  97. };
  98. enum flann_distance_t
  99. {
  100. FLANN_DIST_EUCLIDEAN = 1,
  101. FLANN_DIST_L2 = 1,
  102. FLANN_DIST_MANHATTAN = 2,
  103. FLANN_DIST_L1 = 2,
  104. FLANN_DIST_MINKOWSKI = 3,
  105. FLANN_DIST_MAX = 4,
  106. FLANN_DIST_HIST_INTERSECT = 5,
  107. FLANN_DIST_HELLINGER = 6,
  108. FLANN_DIST_CHI_SQUARE = 7,
  109. FLANN_DIST_CS = 7,
  110. FLANN_DIST_KULLBACK_LEIBLER = 8,
  111. FLANN_DIST_KL = 8,
  112. FLANN_DIST_HAMMING = 9,
  113. FLANN_DIST_DNAMMING = 10,
  114. // deprecated constants, should use the FLANN_DIST_* ones instead
  115. EUCLIDEAN = 1,
  116. MANHATTAN = 2,
  117. MINKOWSKI = 3,
  118. MAX_DIST = 4,
  119. HIST_INTERSECT = 5,
  120. HELLINGER = 6,
  121. CS = 7,
  122. KL = 8,
  123. KULLBACK_LEIBLER = 8
  124. };
  125. enum flann_datatype_t
  126. {
  127. FLANN_INT8 = 0,
  128. FLANN_INT16 = 1,
  129. FLANN_INT32 = 2,
  130. FLANN_INT64 = 3,
  131. FLANN_UINT8 = 4,
  132. FLANN_UINT16 = 5,
  133. FLANN_UINT32 = 6,
  134. FLANN_UINT64 = 7,
  135. FLANN_FLOAT32 = 8,
  136. FLANN_FLOAT64 = 9
  137. };
  138. enum
  139. {
  140. FLANN_CHECKS_UNLIMITED = -1,
  141. FLANN_CHECKS_AUTOTUNED = -2
  142. };
  143. }
  144. //! @endcond
  145. #endif /* OPENCV_FLANN_DEFINES_H_ */