MapShift.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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. {
  9. // C++: class MapShift
  10. //javadoc: MapShift
  11. public class MapShift : Map
  12. {
  13. protected override void Dispose (bool disposing)
  14. {
  15. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  16. try {
  17. if (disposing) {
  18. }
  19. if (IsEnabledDispose) {
  20. if (nativeObj != IntPtr.Zero)
  21. reg_MapShift_delete (nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal MapShift (IntPtr addr)
  32. : base (addr)
  33. {
  34. }
  35. // internal usage only
  36. public static new MapShift __fromPtr__ (IntPtr addr)
  37. {
  38. return new MapShift (addr);
  39. }
  40. //
  41. // C++: cv::reg::MapShift::MapShift(Mat shift)
  42. //
  43. //javadoc: MapShift::MapShift(shift)
  44. public MapShift (Mat shift) :
  45. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  46. base (reg_MapShift_MapShift_10 (shift.nativeObj))
  47. #else
  48. base (IntPtr.Zero)
  49. #endif
  50. {
  51. return;
  52. }
  53. //
  54. // C++: cv::reg::MapShift::MapShift()
  55. //
  56. //javadoc: MapShift::MapShift()
  57. public MapShift () :
  58. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  59. base (reg_MapShift_MapShift_11 ())
  60. #else
  61. base (IntPtr.Zero)
  62. #endif
  63. {
  64. return;
  65. }
  66. //
  67. // C++: Ptr_Map cv::reg::MapShift::inverseMap()
  68. //
  69. //javadoc: MapShift::inverseMap()
  70. public override Map inverseMap ()
  71. {
  72. ThrowIfDisposed ();
  73. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  74. Map retVal = Map.__fromPtr__ (reg_MapShift_inverseMap_10 (nativeObj));
  75. return retVal;
  76. #else
  77. return null;
  78. #endif
  79. }
  80. //
  81. // C++: void cv::reg::MapShift::compose(Ptr_Map map)
  82. //
  83. //javadoc: MapShift::compose(map)
  84. public override void compose (Map map)
  85. {
  86. ThrowIfDisposed ();
  87. if (map != null)
  88. map.ThrowIfDisposed ();
  89. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  90. reg_MapShift_compose_10 (nativeObj, map.getNativeObjAddr ());
  91. return;
  92. #else
  93. return;
  94. #endif
  95. }
  96. //
  97. // C++: void cv::reg::MapShift::getShift(Mat& shift)
  98. //
  99. //javadoc: MapShift::getShift(shift)
  100. public void getShift (Mat shift)
  101. {
  102. ThrowIfDisposed ();
  103. if (shift != null)
  104. shift.ThrowIfDisposed ();
  105. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  106. reg_MapShift_getShift_10 (nativeObj, shift.nativeObj);
  107. return;
  108. #else
  109. return;
  110. #endif
  111. }
  112. //
  113. // C++: void cv::reg::MapShift::inverseWarp(Mat img1, Mat& img2)
  114. //
  115. //javadoc: MapShift::inverseWarp(img1, img2)
  116. public override void inverseWarp (Mat img1, Mat img2)
  117. {
  118. ThrowIfDisposed ();
  119. if (img1 != null)
  120. img1.ThrowIfDisposed ();
  121. if (img2 != null)
  122. img2.ThrowIfDisposed ();
  123. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  124. reg_MapShift_inverseWarp_10 (nativeObj, img1.nativeObj, img2.nativeObj);
  125. return;
  126. #else
  127. return;
  128. #endif
  129. }
  130. //
  131. // C++: void cv::reg::MapShift::scale(double factor)
  132. //
  133. //javadoc: MapShift::scale(factor)
  134. public override void scale (double factor)
  135. {
  136. ThrowIfDisposed ();
  137. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  138. reg_MapShift_scale_10 (nativeObj, factor);
  139. return;
  140. #else
  141. return;
  142. #endif
  143. }
  144. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  145. const string LIBNAME = "__Internal";
  146. #else
  147. const string LIBNAME = "opencvforunity";
  148. #endif
  149. // C++: cv::reg::MapShift::MapShift(Mat shift)
  150. [DllImport (LIBNAME)]
  151. private static extern IntPtr reg_MapShift_MapShift_10 (IntPtr shift_nativeObj);
  152. // C++: cv::reg::MapShift::MapShift()
  153. [DllImport (LIBNAME)]
  154. private static extern IntPtr reg_MapShift_MapShift_11 ();
  155. // C++: Ptr_Map cv::reg::MapShift::inverseMap()
  156. [DllImport (LIBNAME)]
  157. private static extern IntPtr reg_MapShift_inverseMap_10 (IntPtr nativeObj);
  158. // C++: void cv::reg::MapShift::compose(Ptr_Map map)
  159. [DllImport (LIBNAME)]
  160. private static extern void reg_MapShift_compose_10 (IntPtr nativeObj, IntPtr map_nativeObj);
  161. // C++: void cv::reg::MapShift::getShift(Mat& shift)
  162. [DllImport (LIBNAME)]
  163. private static extern void reg_MapShift_getShift_10 (IntPtr nativeObj, IntPtr shift_nativeObj);
  164. // C++: void cv::reg::MapShift::inverseWarp(Mat img1, Mat& img2)
  165. [DllImport (LIBNAME)]
  166. private static extern void reg_MapShift_inverseWarp_10 (IntPtr nativeObj, IntPtr img1_nativeObj, IntPtr img2_nativeObj);
  167. // C++: void cv::reg::MapShift::scale(double factor)
  168. [DllImport (LIBNAME)]
  169. private static extern void reg_MapShift_scale_10 (IntPtr nativeObj, double factor);
  170. // native support for java finalize()
  171. [DllImport (LIBNAME)]
  172. private static extern void reg_MapShift_delete (IntPtr nativeObj);
  173. }
  174. }