BoostDesc.cs 6.1 KB

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