LearningBasedWB.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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.XphotoModule
  8. {
  9. // C++: class LearningBasedWB
  10. //javadoc: LearningBasedWB
  11. public class LearningBasedWB : WhiteBalancer
  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. xphoto_LearningBasedWB_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal LearningBasedWB (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new LearningBasedWB __fromPtr__ (IntPtr addr) { return new LearningBasedWB (addr); }
  34. //
  35. // C++: float cv::xphoto::LearningBasedWB::getSaturationThreshold()
  36. //
  37. //javadoc: LearningBasedWB::getSaturationThreshold()
  38. public float getSaturationThreshold ()
  39. {
  40. ThrowIfDisposed ();
  41. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  42. float retVal = xphoto_LearningBasedWB_getSaturationThreshold_10(nativeObj);
  43. return retVal;
  44. #else
  45. return -1;
  46. #endif
  47. }
  48. //
  49. // C++: int cv::xphoto::LearningBasedWB::getHistBinNum()
  50. //
  51. //javadoc: LearningBasedWB::getHistBinNum()
  52. public int getHistBinNum ()
  53. {
  54. ThrowIfDisposed ();
  55. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  56. int retVal = xphoto_LearningBasedWB_getHistBinNum_10(nativeObj);
  57. return retVal;
  58. #else
  59. return -1;
  60. #endif
  61. }
  62. //
  63. // C++: int cv::xphoto::LearningBasedWB::getRangeMaxVal()
  64. //
  65. //javadoc: LearningBasedWB::getRangeMaxVal()
  66. public int getRangeMaxVal ()
  67. {
  68. ThrowIfDisposed ();
  69. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  70. int retVal = xphoto_LearningBasedWB_getRangeMaxVal_10(nativeObj);
  71. return retVal;
  72. #else
  73. return -1;
  74. #endif
  75. }
  76. //
  77. // C++: void cv::xphoto::LearningBasedWB::extractSimpleFeatures(Mat src, Mat& dst)
  78. //
  79. //javadoc: LearningBasedWB::extractSimpleFeatures(src, dst)
  80. public void extractSimpleFeatures (Mat src, Mat dst)
  81. {
  82. ThrowIfDisposed ();
  83. if (src != null) src.ThrowIfDisposed ();
  84. if (dst != null) dst.ThrowIfDisposed ();
  85. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  86. xphoto_LearningBasedWB_extractSimpleFeatures_10(nativeObj, src.nativeObj, dst.nativeObj);
  87. return;
  88. #else
  89. return;
  90. #endif
  91. }
  92. //
  93. // C++: void cv::xphoto::LearningBasedWB::setHistBinNum(int val)
  94. //
  95. //javadoc: LearningBasedWB::setHistBinNum(val)
  96. public void setHistBinNum (int val)
  97. {
  98. ThrowIfDisposed ();
  99. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  100. xphoto_LearningBasedWB_setHistBinNum_10(nativeObj, val);
  101. return;
  102. #else
  103. return;
  104. #endif
  105. }
  106. //
  107. // C++: void cv::xphoto::LearningBasedWB::setRangeMaxVal(int val)
  108. //
  109. //javadoc: LearningBasedWB::setRangeMaxVal(val)
  110. public void setRangeMaxVal (int val)
  111. {
  112. ThrowIfDisposed ();
  113. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  114. xphoto_LearningBasedWB_setRangeMaxVal_10(nativeObj, val);
  115. return;
  116. #else
  117. return;
  118. #endif
  119. }
  120. //
  121. // C++: void cv::xphoto::LearningBasedWB::setSaturationThreshold(float val)
  122. //
  123. //javadoc: LearningBasedWB::setSaturationThreshold(val)
  124. public void setSaturationThreshold (float val)
  125. {
  126. ThrowIfDisposed ();
  127. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  128. xphoto_LearningBasedWB_setSaturationThreshold_10(nativeObj, val);
  129. return;
  130. #else
  131. return;
  132. #endif
  133. }
  134. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  135. const string LIBNAME = "__Internal";
  136. #else
  137. const string LIBNAME = "opencvforunity";
  138. #endif
  139. // C++: float cv::xphoto::LearningBasedWB::getSaturationThreshold()
  140. [DllImport (LIBNAME)]
  141. private static extern float xphoto_LearningBasedWB_getSaturationThreshold_10 (IntPtr nativeObj);
  142. // C++: int cv::xphoto::LearningBasedWB::getHistBinNum()
  143. [DllImport (LIBNAME)]
  144. private static extern int xphoto_LearningBasedWB_getHistBinNum_10 (IntPtr nativeObj);
  145. // C++: int cv::xphoto::LearningBasedWB::getRangeMaxVal()
  146. [DllImport (LIBNAME)]
  147. private static extern int xphoto_LearningBasedWB_getRangeMaxVal_10 (IntPtr nativeObj);
  148. // C++: void cv::xphoto::LearningBasedWB::extractSimpleFeatures(Mat src, Mat& dst)
  149. [DllImport (LIBNAME)]
  150. private static extern void xphoto_LearningBasedWB_extractSimpleFeatures_10 (IntPtr nativeObj, IntPtr src_nativeObj, IntPtr dst_nativeObj);
  151. // C++: void cv::xphoto::LearningBasedWB::setHistBinNum(int val)
  152. [DllImport (LIBNAME)]
  153. private static extern void xphoto_LearningBasedWB_setHistBinNum_10 (IntPtr nativeObj, int val);
  154. // C++: void cv::xphoto::LearningBasedWB::setRangeMaxVal(int val)
  155. [DllImport (LIBNAME)]
  156. private static extern void xphoto_LearningBasedWB_setRangeMaxVal_10 (IntPtr nativeObj, int val);
  157. // C++: void cv::xphoto::LearningBasedWB::setSaturationThreshold(float val)
  158. [DllImport (LIBNAME)]
  159. private static extern void xphoto_LearningBasedWB_setSaturationThreshold_10 (IntPtr nativeObj, float val);
  160. // native support for java finalize()
  161. [DllImport (LIBNAME)]
  162. private static extern void xphoto_LearningBasedWB_delete (IntPtr nativeObj);
  163. }
  164. }