MapperPyramid.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.RegModule {
  8. // C++: class MapperPyramid
  9. //javadoc: MapperPyramid
  10. public class MapperPyramid : Mapper {
  11. protected override void Dispose(bool disposing) {
  12. #if (UNITY_ANDROID && !UNITY_EDITOR)
  13. try {
  14. if (disposing) {
  15. }
  16. if (IsEnabledDispose) {
  17. if (nativeObj != IntPtr.Zero)
  18. reg_MapperPyramid_delete(nativeObj);
  19. nativeObj = IntPtr.Zero;
  20. }
  21. } finally {
  22. base.Dispose(disposing);
  23. }
  24. #else
  25. return;
  26. #endif
  27. }
  28. protected internal MapperPyramid(IntPtr addr)
  29. : base(addr) {
  30. }
  31. // internal usage only
  32. public static new MapperPyramid __fromPtr__(IntPtr addr) {
  33. return new MapperPyramid(addr);
  34. }
  35. //
  36. // C++: cv::reg::MapperPyramid::MapperPyramid(Ptr_Mapper baseMapper)
  37. //
  38. //javadoc: MapperPyramid::MapperPyramid(baseMapper)
  39. public MapperPyramid(Mapper baseMapper) :
  40. #if (UNITY_ANDROID && !UNITY_EDITOR)
  41. base(reg_MapperPyramid_MapperPyramid_10(baseMapper.getNativeObjAddr()))
  42. #else
  43. base (IntPtr.Zero)
  44. #endif
  45. {
  46. return;
  47. }
  48. //
  49. // C++: Ptr_Map cv::reg::MapperPyramid::calculate(Mat img1, Mat img2, Ptr_Map init = cv::Ptr<Map>())
  50. //
  51. //javadoc: MapperPyramid::calculate(img1, img2, init)
  52. public override Map calculate(Mat img1, Mat img2, Map init) {
  53. ThrowIfDisposed();
  54. if (img1 != null)
  55. img1.ThrowIfDisposed();
  56. if (img2 != null)
  57. img2.ThrowIfDisposed();
  58. if (init != null)
  59. init.ThrowIfDisposed();
  60. #if (UNITY_ANDROID && !UNITY_EDITOR)
  61. Map retVal = Map.__fromPtr__(reg_MapperPyramid_calculate_10(nativeObj, img1.nativeObj, img2.nativeObj, init.getNativeObjAddr()));
  62. return retVal;
  63. #else
  64. return null;
  65. #endif
  66. }
  67. //javadoc: MapperPyramid::calculate(img1, img2)
  68. public override Map calculate(Mat img1, Mat img2) {
  69. ThrowIfDisposed();
  70. if (img1 != null)
  71. img1.ThrowIfDisposed();
  72. if (img2 != null)
  73. img2.ThrowIfDisposed();
  74. #if (UNITY_ANDROID && !UNITY_EDITOR)
  75. Map retVal = Map.__fromPtr__(reg_MapperPyramid_calculate_11(nativeObj, img1.nativeObj, img2.nativeObj));
  76. return retVal;
  77. #else
  78. return null;
  79. #endif
  80. }
  81. //
  82. // C++: Ptr_Map cv::reg::MapperPyramid::getMap()
  83. //
  84. //javadoc: MapperPyramid::getMap()
  85. public override Map getMap() {
  86. ThrowIfDisposed();
  87. #if (UNITY_ANDROID && !UNITY_EDITOR)
  88. Map retVal = Map.__fromPtr__(reg_MapperPyramid_getMap_10(nativeObj));
  89. return retVal;
  90. #else
  91. return null;
  92. #endif
  93. }
  94. //
  95. // C++: int MapperPyramid::numLev_
  96. //
  97. //javadoc: MapperPyramid::get_numLev_()
  98. public int get_numLev_() {
  99. ThrowIfDisposed();
  100. #if (UNITY_ANDROID && !UNITY_EDITOR)
  101. int retVal = reg_MapperPyramid_get_1numLev_1_10(nativeObj);
  102. return retVal;
  103. #else
  104. return -1;
  105. #endif
  106. }
  107. //
  108. // C++: void MapperPyramid::numLev_
  109. //
  110. //javadoc: MapperPyramid::set_numLev_(numLev_)
  111. public void set_numLev_(int numLev_) {
  112. ThrowIfDisposed();
  113. #if (UNITY_ANDROID && !UNITY_EDITOR)
  114. reg_MapperPyramid_set_1numLev_1_10(nativeObj, numLev_);
  115. return;
  116. #else
  117. return;
  118. #endif
  119. }
  120. //
  121. // C++: int MapperPyramid::numIterPerScale_
  122. //
  123. //javadoc: MapperPyramid::get_numIterPerScale_()
  124. public int get_numIterPerScale_() {
  125. ThrowIfDisposed();
  126. #if (UNITY_ANDROID && !UNITY_EDITOR)
  127. int retVal = reg_MapperPyramid_get_1numIterPerScale_1_10(nativeObj);
  128. return retVal;
  129. #else
  130. return -1;
  131. #endif
  132. }
  133. //
  134. // C++: void MapperPyramid::numIterPerScale_
  135. //
  136. //javadoc: MapperPyramid::set_numIterPerScale_(numIterPerScale_)
  137. public void set_numIterPerScale_(int numIterPerScale_) {
  138. ThrowIfDisposed();
  139. #if (UNITY_ANDROID && !UNITY_EDITOR)
  140. reg_MapperPyramid_set_1numIterPerScale_1_10(nativeObj, numIterPerScale_);
  141. return;
  142. #else
  143. return;
  144. #endif
  145. }
  146. #if (UNITY_ANDROID && !UNITY_EDITOR)
  147. const string LIBNAME = "opencvforunity";
  148. // C++: cv::reg::MapperPyramid::MapperPyramid(Ptr_Mapper baseMapper)
  149. [DllImport(LIBNAME)]
  150. private static extern IntPtr reg_MapperPyramid_MapperPyramid_10(IntPtr baseMapper_nativeObj);
  151. // C++: Ptr_Map cv::reg::MapperPyramid::calculate(Mat img1, Mat img2, Ptr_Map init = cv::Ptr<Map>())
  152. [DllImport(LIBNAME)]
  153. private static extern IntPtr reg_MapperPyramid_calculate_10(IntPtr nativeObj, IntPtr img1_nativeObj, IntPtr img2_nativeObj, IntPtr init_nativeObj);
  154. [DllImport(LIBNAME)]
  155. private static extern IntPtr reg_MapperPyramid_calculate_11(IntPtr nativeObj, IntPtr img1_nativeObj, IntPtr img2_nativeObj);
  156. // C++: Ptr_Map cv::reg::MapperPyramid::getMap()
  157. [DllImport(LIBNAME)]
  158. private static extern IntPtr reg_MapperPyramid_getMap_10(IntPtr nativeObj);
  159. // C++: int MapperPyramid::numLev_
  160. [DllImport(LIBNAME)]
  161. private static extern int reg_MapperPyramid_get_1numLev_1_10(IntPtr nativeObj);
  162. // C++: void MapperPyramid::numLev_
  163. [DllImport(LIBNAME)]
  164. private static extern void reg_MapperPyramid_set_1numLev_1_10(IntPtr nativeObj, int numLev_);
  165. // C++: int MapperPyramid::numIterPerScale_
  166. [DllImport(LIBNAME)]
  167. private static extern int reg_MapperPyramid_get_1numIterPerScale_1_10(IntPtr nativeObj);
  168. // C++: void MapperPyramid::numIterPerScale_
  169. [DllImport(LIBNAME)]
  170. private static extern void reg_MapperPyramid_set_1numIterPerScale_1_10(IntPtr nativeObj, int numIterPerScale_);
  171. // native support for java finalize()
  172. [DllImport(LIBNAME)]
  173. private static extern void reg_MapperPyramid_delete(IntPtr nativeObj);
  174. #endif
  175. }
  176. }