Objectness.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.SaliencyModule
  8. {
  9. // C++: class Objectness
  10. //javadoc: Objectness
  11. public class Objectness : Saliency
  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. saliency_Objectness_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal Objectness (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new Objectness __fromPtr__ (IntPtr addr) { return new Objectness (addr); }
  34. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  35. const string LIBNAME = "__Internal";
  36. #else
  37. const string LIBNAME = "opencvforunity";
  38. #endif
  39. // native support for java finalize()
  40. [DllImport (LIBNAME)]
  41. private static extern void saliency_Objectness_delete (IntPtr nativeObj);
  42. }
  43. }