SelectiveSearchSegmentationStrategyMultiple.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.XimgprocModule
  7. {
  8. // C++: class SelectiveSearchSegmentationStrategyMultiple
  9. /**
  10. * Regroup multiple strategies for the selective search segmentation algorithm
  11. */
  12. public class SelectiveSearchSegmentationStrategyMultiple : SelectiveSearchSegmentationStrategy
  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. ximgproc_SelectiveSearchSegmentationStrategyMultiple_delete(nativeObj);
  25. nativeObj = IntPtr.Zero;
  26. }
  27. }
  28. finally
  29. {
  30. base.Dispose(disposing);
  31. }
  32. }
  33. protected internal SelectiveSearchSegmentationStrategyMultiple(IntPtr addr) : base(addr) { }
  34. // internal usage only
  35. public static new SelectiveSearchSegmentationStrategyMultiple __fromPtr__(IntPtr addr) { return new SelectiveSearchSegmentationStrategyMultiple(addr); }
  36. //
  37. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentationStrategyMultiple::addStrategy(Ptr_SelectiveSearchSegmentationStrategy g, float weight)
  38. //
  39. /**
  40. * Add a new sub-strategy
  41. * param g The strategy
  42. * param weight The weight of the strategy
  43. */
  44. public void addStrategy(SelectiveSearchSegmentationStrategy g, float weight)
  45. {
  46. ThrowIfDisposed();
  47. if (g != null) g.ThrowIfDisposed();
  48. ximgproc_SelectiveSearchSegmentationStrategyMultiple_addStrategy_10(nativeObj, g.getNativeObjAddr(), weight);
  49. }
  50. //
  51. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentationStrategyMultiple::clearStrategies()
  52. //
  53. /**
  54. * Remove all sub-strategies
  55. */
  56. public void clearStrategies()
  57. {
  58. ThrowIfDisposed();
  59. ximgproc_SelectiveSearchSegmentationStrategyMultiple_clearStrategies_10(nativeObj);
  60. }
  61. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  62. const string LIBNAME = "__Internal";
  63. #else
  64. const string LIBNAME = "opencvforunity";
  65. #endif
  66. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentationStrategyMultiple::addStrategy(Ptr_SelectiveSearchSegmentationStrategy g, float weight)
  67. [DllImport(LIBNAME)]
  68. private static extern void ximgproc_SelectiveSearchSegmentationStrategyMultiple_addStrategy_10(IntPtr nativeObj, IntPtr g_nativeObj, float weight);
  69. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentationStrategyMultiple::clearStrategies()
  70. [DllImport(LIBNAME)]
  71. private static extern void ximgproc_SelectiveSearchSegmentationStrategyMultiple_clearStrategies_10(IntPtr nativeObj);
  72. // native support for java finalize()
  73. [DllImport(LIBNAME)]
  74. private static extern void ximgproc_SelectiveSearchSegmentationStrategyMultiple_delete(IntPtr nativeObj);
  75. }
  76. }