SimpleWB.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.XphotoModule
  7. {
  8. // C++: class SimpleWB
  9. /**
  10. * A simple white balance algorithm that works by independently stretching
  11. * each of the input image channels to the specified range. For increased robustness
  12. * it ignores the top and bottom \(p\%\) of pixel values.
  13. */
  14. public class SimpleWB : WhiteBalancer
  15. {
  16. protected override void Dispose(bool disposing)
  17. {
  18. try
  19. {
  20. if (disposing)
  21. {
  22. }
  23. if (IsEnabledDispose)
  24. {
  25. if (nativeObj != IntPtr.Zero)
  26. xphoto_SimpleWB_delete(nativeObj);
  27. nativeObj = IntPtr.Zero;
  28. }
  29. }
  30. finally
  31. {
  32. base.Dispose(disposing);
  33. }
  34. }
  35. protected internal SimpleWB(IntPtr addr) : base(addr) { }
  36. // internal usage only
  37. public static new SimpleWB __fromPtr__(IntPtr addr) { return new SimpleWB(addr); }
  38. //
  39. // C++: float cv::xphoto::SimpleWB::getInputMin()
  40. //
  41. /**
  42. * Input image range minimum value
  43. * SEE: setInputMin
  44. * return automatically generated
  45. */
  46. public float getInputMin()
  47. {
  48. ThrowIfDisposed();
  49. return xphoto_SimpleWB_getInputMin_10(nativeObj);
  50. }
  51. //
  52. // C++: void cv::xphoto::SimpleWB::setInputMin(float val)
  53. //
  54. /**
  55. * getInputMin SEE: getInputMin
  56. * param val automatically generated
  57. */
  58. public void setInputMin(float val)
  59. {
  60. ThrowIfDisposed();
  61. xphoto_SimpleWB_setInputMin_10(nativeObj, val);
  62. }
  63. //
  64. // C++: float cv::xphoto::SimpleWB::getInputMax()
  65. //
  66. /**
  67. * Input image range maximum value
  68. * SEE: setInputMax
  69. * return automatically generated
  70. */
  71. public float getInputMax()
  72. {
  73. ThrowIfDisposed();
  74. return xphoto_SimpleWB_getInputMax_10(nativeObj);
  75. }
  76. //
  77. // C++: void cv::xphoto::SimpleWB::setInputMax(float val)
  78. //
  79. /**
  80. * getInputMax SEE: getInputMax
  81. * param val automatically generated
  82. */
  83. public void setInputMax(float val)
  84. {
  85. ThrowIfDisposed();
  86. xphoto_SimpleWB_setInputMax_10(nativeObj, val);
  87. }
  88. //
  89. // C++: float cv::xphoto::SimpleWB::getOutputMin()
  90. //
  91. /**
  92. * Output image range minimum value
  93. * SEE: setOutputMin
  94. * return automatically generated
  95. */
  96. public float getOutputMin()
  97. {
  98. ThrowIfDisposed();
  99. return xphoto_SimpleWB_getOutputMin_10(nativeObj);
  100. }
  101. //
  102. // C++: void cv::xphoto::SimpleWB::setOutputMin(float val)
  103. //
  104. /**
  105. * getOutputMin SEE: getOutputMin
  106. * param val automatically generated
  107. */
  108. public void setOutputMin(float val)
  109. {
  110. ThrowIfDisposed();
  111. xphoto_SimpleWB_setOutputMin_10(nativeObj, val);
  112. }
  113. //
  114. // C++: float cv::xphoto::SimpleWB::getOutputMax()
  115. //
  116. /**
  117. * Output image range maximum value
  118. * SEE: setOutputMax
  119. * return automatically generated
  120. */
  121. public float getOutputMax()
  122. {
  123. ThrowIfDisposed();
  124. return xphoto_SimpleWB_getOutputMax_10(nativeObj);
  125. }
  126. //
  127. // C++: void cv::xphoto::SimpleWB::setOutputMax(float val)
  128. //
  129. /**
  130. * getOutputMax SEE: getOutputMax
  131. * param val automatically generated
  132. */
  133. public void setOutputMax(float val)
  134. {
  135. ThrowIfDisposed();
  136. xphoto_SimpleWB_setOutputMax_10(nativeObj, val);
  137. }
  138. //
  139. // C++: float cv::xphoto::SimpleWB::getP()
  140. //
  141. /**
  142. * Percent of top/bottom values to ignore
  143. * SEE: setP
  144. * return automatically generated
  145. */
  146. public float getP()
  147. {
  148. ThrowIfDisposed();
  149. return xphoto_SimpleWB_getP_10(nativeObj);
  150. }
  151. //
  152. // C++: void cv::xphoto::SimpleWB::setP(float val)
  153. //
  154. /**
  155. * getP SEE: getP
  156. * param val automatically generated
  157. */
  158. public void setP(float val)
  159. {
  160. ThrowIfDisposed();
  161. xphoto_SimpleWB_setP_10(nativeObj, val);
  162. }
  163. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  164. const string LIBNAME = "__Internal";
  165. #else
  166. const string LIBNAME = "opencvforunity";
  167. #endif
  168. // C++: float cv::xphoto::SimpleWB::getInputMin()
  169. [DllImport(LIBNAME)]
  170. private static extern float xphoto_SimpleWB_getInputMin_10(IntPtr nativeObj);
  171. // C++: void cv::xphoto::SimpleWB::setInputMin(float val)
  172. [DllImport(LIBNAME)]
  173. private static extern void xphoto_SimpleWB_setInputMin_10(IntPtr nativeObj, float val);
  174. // C++: float cv::xphoto::SimpleWB::getInputMax()
  175. [DllImport(LIBNAME)]
  176. private static extern float xphoto_SimpleWB_getInputMax_10(IntPtr nativeObj);
  177. // C++: void cv::xphoto::SimpleWB::setInputMax(float val)
  178. [DllImport(LIBNAME)]
  179. private static extern void xphoto_SimpleWB_setInputMax_10(IntPtr nativeObj, float val);
  180. // C++: float cv::xphoto::SimpleWB::getOutputMin()
  181. [DllImport(LIBNAME)]
  182. private static extern float xphoto_SimpleWB_getOutputMin_10(IntPtr nativeObj);
  183. // C++: void cv::xphoto::SimpleWB::setOutputMin(float val)
  184. [DllImport(LIBNAME)]
  185. private static extern void xphoto_SimpleWB_setOutputMin_10(IntPtr nativeObj, float val);
  186. // C++: float cv::xphoto::SimpleWB::getOutputMax()
  187. [DllImport(LIBNAME)]
  188. private static extern float xphoto_SimpleWB_getOutputMax_10(IntPtr nativeObj);
  189. // C++: void cv::xphoto::SimpleWB::setOutputMax(float val)
  190. [DllImport(LIBNAME)]
  191. private static extern void xphoto_SimpleWB_setOutputMax_10(IntPtr nativeObj, float val);
  192. // C++: float cv::xphoto::SimpleWB::getP()
  193. [DllImport(LIBNAME)]
  194. private static extern float xphoto_SimpleWB_getP_10(IntPtr nativeObj);
  195. // C++: void cv::xphoto::SimpleWB::setP(float val)
  196. [DllImport(LIBNAME)]
  197. private static extern void xphoto_SimpleWB_setP_10(IntPtr nativeObj, float val);
  198. // native support for java finalize()
  199. [DllImport(LIBNAME)]
  200. private static extern void xphoto_SimpleWB_delete(IntPtr nativeObj);
  201. }
  202. }