ClassifierCallback.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 ClassifierCallback
  10. //javadoc: ClassifierCallback
  11. public class ClassifierCallback : DisposableOpenCVObject
  12. {
  13. protected override void Dispose (bool disposing)
  14. {
  15. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  16. try {
  17. if (disposing) {
  18. }
  19. if (IsEnabledDispose) {
  20. if (nativeObj != IntPtr.Zero)
  21. text_ClassifierCallback_delete (nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal ClassifierCallback (IntPtr addr)
  32. : base (addr)
  33. {
  34. }
  35. public IntPtr getNativeObjAddr ()
  36. {
  37. return nativeObj;
  38. }
  39. // internal usage only
  40. public static ClassifierCallback __fromPtr__ (IntPtr addr)
  41. {
  42. return new ClassifierCallback (addr);
  43. }
  44. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  45. const string LIBNAME = "__Internal";
  46. #else
  47. const string LIBNAME = "opencvforunity";
  48. #endif
  49. // native support for java finalize()
  50. [DllImport (LIBNAME)]
  51. private static extern void text_ClassifierCallback_delete (IntPtr nativeObj);
  52. }
  53. }
  54. #endif