BoostDesc.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.Features2dModule;
  4. using OpenCVForUnity.UtilsModule;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Runtime.InteropServices;
  8. namespace OpenCVForUnity.Xfeatures2dModule
  9. {
  10. // C++: class BoostDesc
  11. //javadoc: BoostDesc
  12. public class BoostDesc : Feature2D
  13. {
  14. protected override void Dispose (bool disposing)
  15. {
  16. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  17. try {
  18. if (disposing) {
  19. }
  20. if (IsEnabledDispose) {
  21. if (nativeObj != IntPtr.Zero)
  22. xfeatures2d_BoostDesc_delete(nativeObj);
  23. nativeObj = IntPtr.Zero;
  24. }
  25. } finally {
  26. base.Dispose (disposing);
  27. }
  28. #else
  29. return;
  30. #endif
  31. }
  32. protected internal BoostDesc (IntPtr addr) : base (addr) { }
  33. // internal usage only
  34. public static new BoostDesc __fromPtr__ (IntPtr addr) { return new BoostDesc (addr); }
  35. //
  36. // C++: static Ptr_BoostDesc cv::xfeatures2d::BoostDesc::create(int desc = BoostDesc::BINBOOST_256, bool use_scale_orientation = true, float scale_factor = 6.25f)
  37. //
  38. //javadoc: BoostDesc::create(desc, use_scale_orientation, scale_factor)
  39. public static BoostDesc create (int desc, bool use_scale_orientation, float scale_factor)
  40. {
  41. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  42. BoostDesc retVal = BoostDesc.__fromPtr__(xfeatures2d_BoostDesc_create_10(desc, use_scale_orientation, scale_factor));
  43. return retVal;
  44. #else
  45. return null;
  46. #endif
  47. }
  48. //javadoc: BoostDesc::create(desc, use_scale_orientation)
  49. public static BoostDesc create (int desc, bool use_scale_orientation)
  50. {
  51. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  52. BoostDesc retVal = BoostDesc.__fromPtr__(xfeatures2d_BoostDesc_create_11(desc, use_scale_orientation));
  53. return retVal;
  54. #else
  55. return null;
  56. #endif
  57. }
  58. //javadoc: BoostDesc::create(desc)
  59. public static BoostDesc create (int desc)
  60. {
  61. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  62. BoostDesc retVal = BoostDesc.__fromPtr__(xfeatures2d_BoostDesc_create_12(desc));
  63. return retVal;
  64. #else
  65. return null;
  66. #endif
  67. }
  68. //javadoc: BoostDesc::create()
  69. public static BoostDesc create ()
  70. {
  71. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  72. BoostDesc retVal = BoostDesc.__fromPtr__(xfeatures2d_BoostDesc_create_13());
  73. return retVal;
  74. #else
  75. return null;
  76. #endif
  77. }
  78. //
  79. // C++: bool cv::xfeatures2d::BoostDesc::getUseScaleOrientation()
  80. //
  81. //javadoc: BoostDesc::getUseScaleOrientation()
  82. public bool getUseScaleOrientation ()
  83. {
  84. ThrowIfDisposed ();
  85. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  86. bool retVal = xfeatures2d_BoostDesc_getUseScaleOrientation_10(nativeObj);
  87. return retVal;
  88. #else
  89. return false;
  90. #endif
  91. }
  92. //
  93. // C++: float cv::xfeatures2d::BoostDesc::getScaleFactor()
  94. //
  95. //javadoc: BoostDesc::getScaleFactor()
  96. public float getScaleFactor ()
  97. {
  98. ThrowIfDisposed ();
  99. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  100. float retVal = xfeatures2d_BoostDesc_getScaleFactor_10(nativeObj);
  101. return retVal;
  102. #else
  103. return -1;
  104. #endif
  105. }
  106. //
  107. // C++: void cv::xfeatures2d::BoostDesc::setScaleFactor(float scale_factor)
  108. //
  109. //javadoc: BoostDesc::setScaleFactor(scale_factor)
  110. public void setScaleFactor (float scale_factor)
  111. {
  112. ThrowIfDisposed ();
  113. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  114. xfeatures2d_BoostDesc_setScaleFactor_10(nativeObj, scale_factor);
  115. return;
  116. #else
  117. return;
  118. #endif
  119. }
  120. //
  121. // C++: void cv::xfeatures2d::BoostDesc::setUseScaleOrientation(bool use_scale_orientation)
  122. //
  123. //javadoc: BoostDesc::setUseScaleOrientation(use_scale_orientation)
  124. public void setUseScaleOrientation (bool use_scale_orientation)
  125. {
  126. ThrowIfDisposed ();
  127. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  128. xfeatures2d_BoostDesc_setUseScaleOrientation_10(nativeObj, use_scale_orientation);
  129. return;
  130. #else
  131. return;
  132. #endif
  133. }
  134. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  135. const string LIBNAME = "__Internal";
  136. #else
  137. const string LIBNAME = "opencvforunity";
  138. #endif
  139. // C++: static Ptr_BoostDesc cv::xfeatures2d::BoostDesc::create(int desc = BoostDesc::BINBOOST_256, bool use_scale_orientation = true, float scale_factor = 6.25f)
  140. [DllImport (LIBNAME)]
  141. private static extern IntPtr xfeatures2d_BoostDesc_create_10 (int desc, bool use_scale_orientation, float scale_factor);
  142. [DllImport (LIBNAME)]
  143. private static extern IntPtr xfeatures2d_BoostDesc_create_11 (int desc, bool use_scale_orientation);
  144. [DllImport (LIBNAME)]
  145. private static extern IntPtr xfeatures2d_BoostDesc_create_12 (int desc);
  146. [DllImport (LIBNAME)]
  147. private static extern IntPtr xfeatures2d_BoostDesc_create_13 ();
  148. // C++: bool cv::xfeatures2d::BoostDesc::getUseScaleOrientation()
  149. [DllImport (LIBNAME)]
  150. private static extern bool xfeatures2d_BoostDesc_getUseScaleOrientation_10 (IntPtr nativeObj);
  151. // C++: float cv::xfeatures2d::BoostDesc::getScaleFactor()
  152. [DllImport (LIBNAME)]
  153. private static extern float xfeatures2d_BoostDesc_getScaleFactor_10 (IntPtr nativeObj);
  154. // C++: void cv::xfeatures2d::BoostDesc::setScaleFactor(float scale_factor)
  155. [DllImport (LIBNAME)]
  156. private static extern void xfeatures2d_BoostDesc_setScaleFactor_10 (IntPtr nativeObj, float scale_factor);
  157. // C++: void cv::xfeatures2d::BoostDesc::setUseScaleOrientation(bool use_scale_orientation)
  158. [DllImport (LIBNAME)]
  159. private static extern void xfeatures2d_BoostDesc_setUseScaleOrientation_10 (IntPtr nativeObj, bool use_scale_orientation);
  160. // native support for java finalize()
  161. [DllImport (LIBNAME)]
  162. private static extern void xfeatures2d_BoostDesc_delete (IntPtr nativeObj);
  163. }
  164. }