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