MapAffine.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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 MapAffine
  10. //javadoc: MapAffine
  11. public class MapAffine : 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_MapAffine_delete (nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal MapAffine (IntPtr addr)
  32. : base (addr)
  33. {
  34. }
  35. // internal usage only
  36. public static new MapAffine __fromPtr__ (IntPtr addr)
  37. {
  38. return new MapAffine (addr);
  39. }
  40. //
  41. // C++: cv::reg::MapAffine::MapAffine(Mat linTr, Mat shift)
  42. //
  43. //javadoc: MapAffine::MapAffine(linTr, shift)
  44. public MapAffine (Mat linTr, Mat shift) :
  45. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  46. base (reg_MapAffine_MapAffine_10 (linTr.nativeObj, shift.nativeObj))
  47. #else
  48. base (IntPtr.Zero)
  49. #endif
  50. {
  51. return;
  52. }
  53. //
  54. // C++: cv::reg::MapAffine::MapAffine()
  55. //
  56. //javadoc: MapAffine::MapAffine()
  57. public MapAffine () :
  58. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  59. base (reg_MapAffine_MapAffine_11 ())
  60. #else
  61. base (IntPtr.Zero)
  62. #endif
  63. {
  64. return;
  65. }
  66. //
  67. // C++: Ptr_Map cv::reg::MapAffine::inverseMap()
  68. //
  69. //javadoc: MapAffine::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_MapAffine_inverseMap_10 (nativeObj));
  75. return retVal;
  76. #else
  77. return null;
  78. #endif
  79. }
  80. //
  81. // C++: void cv::reg::MapAffine::compose(Ptr_Map map)
  82. //
  83. //javadoc: MapAffine::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_MapAffine_compose_10 (nativeObj, map.getNativeObjAddr ());
  91. return;
  92. #else
  93. return;
  94. #endif
  95. }
  96. //
  97. // C++: void cv::reg::MapAffine::getLinTr(Mat& linTr)
  98. //
  99. //javadoc: MapAffine::getLinTr(linTr)
  100. public void getLinTr (Mat linTr)
  101. {
  102. ThrowIfDisposed ();
  103. if (linTr != null)
  104. linTr.ThrowIfDisposed ();
  105. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  106. reg_MapAffine_getLinTr_10 (nativeObj, linTr.nativeObj);
  107. return;
  108. #else
  109. return;
  110. #endif
  111. }
  112. //
  113. // C++: void cv::reg::MapAffine::getShift(Mat& shift)
  114. //
  115. //javadoc: MapAffine::getShift(shift)
  116. public void getShift (Mat shift)
  117. {
  118. ThrowIfDisposed ();
  119. if (shift != null)
  120. shift.ThrowIfDisposed ();
  121. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  122. reg_MapAffine_getShift_10 (nativeObj, shift.nativeObj);
  123. return;
  124. #else
  125. return;
  126. #endif
  127. }
  128. //
  129. // C++: void cv::reg::MapAffine::inverseWarp(Mat img1, Mat& img2)
  130. //
  131. //javadoc: MapAffine::inverseWarp(img1, img2)
  132. public override void inverseWarp (Mat img1, Mat img2)
  133. {
  134. ThrowIfDisposed ();
  135. if (img1 != null)
  136. img1.ThrowIfDisposed ();
  137. if (img2 != null)
  138. img2.ThrowIfDisposed ();
  139. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  140. reg_MapAffine_inverseWarp_10 (nativeObj, img1.nativeObj, img2.nativeObj);
  141. return;
  142. #else
  143. return;
  144. #endif
  145. }
  146. //
  147. // C++: void cv::reg::MapAffine::scale(double factor)
  148. //
  149. //javadoc: MapAffine::scale(factor)
  150. public override void scale (double factor)
  151. {
  152. ThrowIfDisposed ();
  153. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  154. reg_MapAffine_scale_10 (nativeObj, factor);
  155. return;
  156. #else
  157. return;
  158. #endif
  159. }
  160. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  161. const string LIBNAME = "__Internal";
  162. #else
  163. const string LIBNAME = "opencvforunity";
  164. #endif
  165. // C++: cv::reg::MapAffine::MapAffine(Mat linTr, Mat shift)
  166. [DllImport (LIBNAME)]
  167. private static extern IntPtr reg_MapAffine_MapAffine_10 (IntPtr linTr_nativeObj, IntPtr shift_nativeObj);
  168. // C++: cv::reg::MapAffine::MapAffine()
  169. [DllImport (LIBNAME)]
  170. private static extern IntPtr reg_MapAffine_MapAffine_11 ();
  171. // C++: Ptr_Map cv::reg::MapAffine::inverseMap()
  172. [DllImport (LIBNAME)]
  173. private static extern IntPtr reg_MapAffine_inverseMap_10 (IntPtr nativeObj);
  174. // C++: void cv::reg::MapAffine::compose(Ptr_Map map)
  175. [DllImport (LIBNAME)]
  176. private static extern void reg_MapAffine_compose_10 (IntPtr nativeObj, IntPtr map_nativeObj);
  177. // C++: void cv::reg::MapAffine::getLinTr(Mat& linTr)
  178. [DllImport (LIBNAME)]
  179. private static extern void reg_MapAffine_getLinTr_10 (IntPtr nativeObj, IntPtr linTr_nativeObj);
  180. // C++: void cv::reg::MapAffine::getShift(Mat& shift)
  181. [DllImport (LIBNAME)]
  182. private static extern void reg_MapAffine_getShift_10 (IntPtr nativeObj, IntPtr shift_nativeObj);
  183. // C++: void cv::reg::MapAffine::inverseWarp(Mat img1, Mat& img2)
  184. [DllImport (LIBNAME)]
  185. private static extern void reg_MapAffine_inverseWarp_10 (IntPtr nativeObj, IntPtr img1_nativeObj, IntPtr img2_nativeObj);
  186. // C++: void cv::reg::MapAffine::scale(double factor)
  187. [DllImport (LIBNAME)]
  188. private static extern void reg_MapAffine_scale_10 (IntPtr nativeObj, double factor);
  189. // native support for java finalize()
  190. [DllImport (LIBNAME)]
  191. private static extern void reg_MapAffine_delete (IntPtr nativeObj);
  192. }
  193. }