TonemapDurand.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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.PhotoModule {
  8. // C++: class TonemapDurand
  9. //javadoc: TonemapDurand
  10. public class TonemapDurand : Tonemap {
  11. protected override void Dispose(bool disposing) {
  12. #if (UNITY_ANDROID && !UNITY_EDITOR)
  13. try {
  14. if (disposing) {
  15. }
  16. if (IsEnabledDispose) {
  17. if (nativeObj != IntPtr.Zero)
  18. photo_TonemapDurand_delete(nativeObj);
  19. nativeObj = IntPtr.Zero;
  20. }
  21. } finally {
  22. base.Dispose(disposing);
  23. }
  24. #else
  25. return;
  26. #endif
  27. }
  28. protected internal TonemapDurand(IntPtr addr) : base(addr) { }
  29. // internal usage only
  30. public static new TonemapDurand __fromPtr__(IntPtr addr) { return new TonemapDurand(addr); }
  31. //
  32. // C++: float cv::TonemapDurand::getContrast()
  33. //
  34. //javadoc: TonemapDurand::getContrast()
  35. public float getContrast() {
  36. ThrowIfDisposed();
  37. #if (UNITY_ANDROID && !UNITY_EDITOR)
  38. float retVal = photo_TonemapDurand_getContrast_10(nativeObj);
  39. return retVal;
  40. #else
  41. return -1;
  42. #endif
  43. }
  44. //
  45. // C++: float cv::TonemapDurand::getSaturation()
  46. //
  47. //javadoc: TonemapDurand::getSaturation()
  48. public float getSaturation() {
  49. ThrowIfDisposed();
  50. #if (UNITY_ANDROID && !UNITY_EDITOR)
  51. float retVal = photo_TonemapDurand_getSaturation_10(nativeObj);
  52. return retVal;
  53. #else
  54. return -1;
  55. #endif
  56. }
  57. //
  58. // C++: float cv::TonemapDurand::getSigmaColor()
  59. //
  60. //javadoc: TonemapDurand::getSigmaColor()
  61. public float getSigmaColor() {
  62. ThrowIfDisposed();
  63. #if (UNITY_ANDROID && !UNITY_EDITOR)
  64. float retVal = photo_TonemapDurand_getSigmaColor_10(nativeObj);
  65. return retVal;
  66. #else
  67. return -1;
  68. #endif
  69. }
  70. //
  71. // C++: float cv::TonemapDurand::getSigmaSpace()
  72. //
  73. //javadoc: TonemapDurand::getSigmaSpace()
  74. public float getSigmaSpace() {
  75. ThrowIfDisposed();
  76. #if (UNITY_ANDROID && !UNITY_EDITOR)
  77. float retVal = photo_TonemapDurand_getSigmaSpace_10(nativeObj);
  78. return retVal;
  79. #else
  80. return -1;
  81. #endif
  82. }
  83. //
  84. // C++: void cv::TonemapDurand::setContrast(float contrast)
  85. //
  86. //javadoc: TonemapDurand::setContrast(contrast)
  87. public void setContrast(float contrast) {
  88. ThrowIfDisposed();
  89. #if (UNITY_ANDROID && !UNITY_EDITOR)
  90. photo_TonemapDurand_setContrast_10(nativeObj, contrast);
  91. return;
  92. #else
  93. return;
  94. #endif
  95. }
  96. //
  97. // C++: void cv::TonemapDurand::setSaturation(float saturation)
  98. //
  99. //javadoc: TonemapDurand::setSaturation(saturation)
  100. public void setSaturation(float saturation) {
  101. ThrowIfDisposed();
  102. #if (UNITY_ANDROID && !UNITY_EDITOR)
  103. photo_TonemapDurand_setSaturation_10(nativeObj, saturation);
  104. return;
  105. #else
  106. return;
  107. #endif
  108. }
  109. //
  110. // C++: void cv::TonemapDurand::setSigmaColor(float sigma_color)
  111. //
  112. //javadoc: TonemapDurand::setSigmaColor(sigma_color)
  113. public void setSigmaColor(float sigma_color) {
  114. ThrowIfDisposed();
  115. #if (UNITY_ANDROID && !UNITY_EDITOR)
  116. photo_TonemapDurand_setSigmaColor_10(nativeObj, sigma_color);
  117. return;
  118. #else
  119. return;
  120. #endif
  121. }
  122. //
  123. // C++: void cv::TonemapDurand::setSigmaSpace(float sigma_space)
  124. //
  125. //javadoc: TonemapDurand::setSigmaSpace(sigma_space)
  126. public void setSigmaSpace(float sigma_space) {
  127. ThrowIfDisposed();
  128. #if (UNITY_ANDROID && !UNITY_EDITOR)
  129. photo_TonemapDurand_setSigmaSpace_10(nativeObj, sigma_space);
  130. return;
  131. #else
  132. return;
  133. #endif
  134. }
  135. #if (UNITY_ANDROID && !UNITY_EDITOR)
  136. const string LIBNAME = "opencvforunity";
  137. // C++: float cv::TonemapDurand::getContrast()
  138. [DllImport(LIBNAME)]
  139. private static extern float photo_TonemapDurand_getContrast_10(IntPtr nativeObj);
  140. // C++: float cv::TonemapDurand::getSaturation()
  141. [DllImport(LIBNAME)]
  142. private static extern float photo_TonemapDurand_getSaturation_10(IntPtr nativeObj);
  143. // C++: float cv::TonemapDurand::getSigmaColor()
  144. [DllImport(LIBNAME)]
  145. private static extern float photo_TonemapDurand_getSigmaColor_10(IntPtr nativeObj);
  146. // C++: float cv::TonemapDurand::getSigmaSpace()
  147. [DllImport(LIBNAME)]
  148. private static extern float photo_TonemapDurand_getSigmaSpace_10(IntPtr nativeObj);
  149. // C++: void cv::TonemapDurand::setContrast(float contrast)
  150. [DllImport(LIBNAME)]
  151. private static extern void photo_TonemapDurand_setContrast_10(IntPtr nativeObj, float contrast);
  152. // C++: void cv::TonemapDurand::setSaturation(float saturation)
  153. [DllImport(LIBNAME)]
  154. private static extern void photo_TonemapDurand_setSaturation_10(IntPtr nativeObj, float saturation);
  155. // C++: void cv::TonemapDurand::setSigmaColor(float sigma_color)
  156. [DllImport(LIBNAME)]
  157. private static extern void photo_TonemapDurand_setSigmaColor_10(IntPtr nativeObj, float sigma_color);
  158. // C++: void cv::TonemapDurand::setSigmaSpace(float sigma_space)
  159. [DllImport(LIBNAME)]
  160. private static extern void photo_TonemapDurand_setSigmaSpace_10(IntPtr nativeObj, float sigma_space);
  161. // native support for java finalize()
  162. [DllImport(LIBNAME)]
  163. private static extern void photo_TonemapDurand_delete(IntPtr nativeObj);
  164. #endif
  165. }
  166. }