MapProjec.cs 6.8 KB

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