MapAffine.cs 6.1 KB

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