BackgroundSubtractorLSBPDesc.cs 1.5 KB

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