ThinPlateSplineShapeTransformer.cs 3.0 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 ThinPlateSplineShapeTransformer
  10. //javadoc: ThinPlateSplineShapeTransformer
  11. public class ThinPlateSplineShapeTransformer : 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_ThinPlateSplineShapeTransformer_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal ThinPlateSplineShapeTransformer (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new ThinPlateSplineShapeTransformer __fromPtr__ (IntPtr addr) { return new ThinPlateSplineShapeTransformer (addr); }
  34. //
  35. // C++: double cv::ThinPlateSplineShapeTransformer::getRegularizationParameter()
  36. //
  37. //javadoc: ThinPlateSplineShapeTransformer::getRegularizationParameter()
  38. public double getRegularizationParameter ()
  39. {
  40. ThrowIfDisposed ();
  41. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  42. double retVal = shape_ThinPlateSplineShapeTransformer_getRegularizationParameter_10(nativeObj);
  43. return retVal;
  44. #else
  45. return -1;
  46. #endif
  47. }
  48. //
  49. // C++: void cv::ThinPlateSplineShapeTransformer::setRegularizationParameter(double beta)
  50. //
  51. //javadoc: ThinPlateSplineShapeTransformer::setRegularizationParameter(beta)
  52. public void setRegularizationParameter (double beta)
  53. {
  54. ThrowIfDisposed ();
  55. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  56. shape_ThinPlateSplineShapeTransformer_setRegularizationParameter_10(nativeObj, beta);
  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++: double cv::ThinPlateSplineShapeTransformer::getRegularizationParameter()
  68. [DllImport (LIBNAME)]
  69. private static extern double shape_ThinPlateSplineShapeTransformer_getRegularizationParameter_10 (IntPtr nativeObj);
  70. // C++: void cv::ThinPlateSplineShapeTransformer::setRegularizationParameter(double beta)
  71. [DllImport (LIBNAME)]
  72. private static extern void shape_ThinPlateSplineShapeTransformer_setRegularizationParameter_10 (IntPtr nativeObj, double beta);
  73. // native support for java finalize()
  74. [DllImport (LIBNAME)]
  75. private static extern void shape_ThinPlateSplineShapeTransformer_delete (IntPtr nativeObj);
  76. }
  77. }