OpticalFlowPCAFlow.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. // C++: class OpticalFlowPCAFlow
  10. //javadoc: OpticalFlowPCAFlow
  11. public class OpticalFlowPCAFlow : DenseOpticalFlow {
  12. protected override void Dispose(bool disposing) {
  13. #if (UNITY_ANDROID && !UNITY_EDITOR)
  14. try {
  15. if (disposing) {
  16. }
  17. if (IsEnabledDispose) {
  18. if (nativeObj != IntPtr.Zero)
  19. optflow_OpticalFlowPCAFlow_delete(nativeObj);
  20. nativeObj = IntPtr.Zero;
  21. }
  22. } finally {
  23. base.Dispose(disposing);
  24. }
  25. #else
  26. return;
  27. #endif
  28. }
  29. protected internal OpticalFlowPCAFlow(IntPtr addr) : base(addr) { }
  30. // internal usage only
  31. public static new OpticalFlowPCAFlow __fromPtr__(IntPtr addr) { return new OpticalFlowPCAFlow(addr); }
  32. #if (UNITY_ANDROID && !UNITY_EDITOR)
  33. const string LIBNAME = "opencvforunity";
  34. // native support for java finalize()
  35. [DllImport(LIBNAME)]
  36. private static extern void optflow_OpticalFlowPCAFlow_delete(IntPtr nativeObj);
  37. #endif
  38. }
  39. }