BaseOCR.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #if !UNITY_WSA_10_0
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.TextModule
  8. {
  9. // C++: class BaseOCR
  10. public class BaseOCR : DisposableOpenCVObject
  11. {
  12. protected override void Dispose(bool disposing)
  13. {
  14. try
  15. {
  16. if (disposing)
  17. {
  18. }
  19. if (IsEnabledDispose)
  20. {
  21. if (nativeObj != IntPtr.Zero)
  22. text_BaseOCR_delete(nativeObj);
  23. nativeObj = IntPtr.Zero;
  24. }
  25. }
  26. finally
  27. {
  28. base.Dispose(disposing);
  29. }
  30. }
  31. protected internal BaseOCR(IntPtr addr) : base(addr) { }
  32. public IntPtr getNativeObjAddr() { return nativeObj; }
  33. // internal usage only
  34. public static BaseOCR __fromPtr__(IntPtr addr) { return new BaseOCR(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 text_BaseOCR_delete(IntPtr nativeObj);
  43. }
  44. }
  45. #endif