MSDDetector.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.Features2dModule;
  4. using OpenCVForUnity.UtilsModule;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Runtime.InteropServices;
  8. namespace OpenCVForUnity.Xfeatures2dModule
  9. {
  10. // C++: class MSDDetector
  11. //javadoc: MSDDetector
  12. public class MSDDetector : Feature2D
  13. {
  14. protected override void Dispose (bool disposing)
  15. {
  16. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  17. try {
  18. if (disposing) {
  19. }
  20. if (IsEnabledDispose) {
  21. if (nativeObj != IntPtr.Zero)
  22. xfeatures2d_MSDDetector_delete(nativeObj);
  23. nativeObj = IntPtr.Zero;
  24. }
  25. } finally {
  26. base.Dispose (disposing);
  27. }
  28. #else
  29. return;
  30. #endif
  31. }
  32. protected internal MSDDetector (IntPtr addr) : base (addr) { }
  33. // internal usage only
  34. public static new MSDDetector __fromPtr__ (IntPtr addr) { return new MSDDetector (addr); }
  35. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  36. const string LIBNAME = "__Internal";
  37. #else
  38. const string LIBNAME = "opencvforunity";
  39. #endif
  40. // native support for java finalize()
  41. [DllImport (LIBNAME)]
  42. private static extern void xfeatures2d_MSDDetector_delete (IntPtr nativeObj);
  43. }
  44. }