GPCPatchDescriptor.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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.OptflowModule
  8. {
  9. // C++: class GPCPatchDescriptor
  10. //javadoc: GPCPatchDescriptor
  11. public class GPCPatchDescriptor : DisposableOpenCVObject
  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. optflow_GPCPatchDescriptor_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal GPCPatchDescriptor (IntPtr addr) : base (addr) { }
  32. public IntPtr getNativeObjAddr () { return nativeObj; }
  33. // internal usage only
  34. public static GPCPatchDescriptor __fromPtr__ (IntPtr addr) { return new GPCPatchDescriptor (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 optflow_GPCPatchDescriptor_delete (IntPtr nativeObj);
  43. }
  44. }