AffineTransformer.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.ShapeModule
  8. {
  9. // C++: class AffineTransformer
  10. //javadoc: AffineTransformer
  11. public class AffineTransformer : ShapeTransformer
  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. shape_AffineTransformer_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal AffineTransformer (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new AffineTransformer __fromPtr__ (IntPtr addr) { return new AffineTransformer (addr); }
  34. //
  35. // C++: bool cv::AffineTransformer::getFullAffine()
  36. //
  37. //javadoc: AffineTransformer::getFullAffine()
  38. public bool getFullAffine ()
  39. {
  40. ThrowIfDisposed ();
  41. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  42. bool retVal = shape_AffineTransformer_getFullAffine_10(nativeObj);
  43. return retVal;
  44. #else
  45. return false;
  46. #endif
  47. }
  48. //
  49. // C++: void cv::AffineTransformer::setFullAffine(bool fullAffine)
  50. //
  51. //javadoc: AffineTransformer::setFullAffine(fullAffine)
  52. public void setFullAffine (bool fullAffine)
  53. {
  54. ThrowIfDisposed ();
  55. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  56. shape_AffineTransformer_setFullAffine_10(nativeObj, fullAffine);
  57. return;
  58. #else
  59. return;
  60. #endif
  61. }
  62. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  63. const string LIBNAME = "__Internal";
  64. #else
  65. const string LIBNAME = "opencvforunity";
  66. #endif
  67. // C++: bool cv::AffineTransformer::getFullAffine()
  68. [DllImport (LIBNAME)]
  69. private static extern bool shape_AffineTransformer_getFullAffine_10 (IntPtr nativeObj);
  70. // C++: void cv::AffineTransformer::setFullAffine(bool fullAffine)
  71. [DllImport (LIBNAME)]
  72. private static extern void shape_AffineTransformer_setFullAffine_10 (IntPtr nativeObj, bool fullAffine);
  73. // native support for java finalize()
  74. [DllImport (LIBNAME)]
  75. private static extern void shape_AffineTransformer_delete (IntPtr nativeObj);
  76. }
  77. }