OpticalFlowPCAFlow.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.VideoModule;
  4. using OpenCVForUnity.UtilsModule;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Runtime.InteropServices;
  8. namespace OpenCVForUnity.OptflowModule
  9. {
  10. // C++: class OpticalFlowPCAFlow
  11. //javadoc: OpticalFlowPCAFlow
  12. public class OpticalFlowPCAFlow : DenseOpticalFlow
  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. optflow_OpticalFlowPCAFlow_delete(nativeObj);
  23. nativeObj = IntPtr.Zero;
  24. }
  25. } finally {
  26. base.Dispose (disposing);
  27. }
  28. #else
  29. return;
  30. #endif
  31. }
  32. protected internal OpticalFlowPCAFlow (IntPtr addr) : base (addr) { }
  33. // internal usage only
  34. public static new OpticalFlowPCAFlow __fromPtr__ (IntPtr addr) { return new OpticalFlowPCAFlow (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_OpticalFlowPCAFlow_delete (IntPtr nativeObj);
  43. }
  44. }