BackgroundSubtractorLSBPDesc.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.BgsegmModule {
  8. // C++: class BackgroundSubtractorLSBPDesc
  9. //javadoc: BackgroundSubtractorLSBPDesc
  10. public class BackgroundSubtractorLSBPDesc : DisposableOpenCVObject {
  11. protected override void Dispose(bool disposing) {
  12. #if (UNITY_ANDROID && !UNITY_EDITOR)
  13. try {
  14. if (disposing) {
  15. }
  16. if (IsEnabledDispose) {
  17. if (nativeObj != IntPtr.Zero)
  18. bgsegm_BackgroundSubtractorLSBPDesc_delete(nativeObj);
  19. nativeObj = IntPtr.Zero;
  20. }
  21. } finally {
  22. base.Dispose(disposing);
  23. }
  24. #else
  25. return;
  26. #endif
  27. }
  28. protected internal BackgroundSubtractorLSBPDesc(IntPtr addr) : base(addr) { }
  29. public IntPtr getNativeObjAddr() { return nativeObj; }
  30. // internal usage only
  31. public static BackgroundSubtractorLSBPDesc __fromPtr__(IntPtr addr) { return new BackgroundSubtractorLSBPDesc(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 bgsegm_BackgroundSubtractorLSBPDesc_delete(IntPtr nativeObj);
  37. #endif
  38. }
  39. }