TonemapReinhard.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 TonemapReinhard
  9. //javadoc: TonemapReinhard
  10. public class TonemapReinhard : 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_TonemapReinhard_delete(nativeObj);
  19. nativeObj = IntPtr.Zero;
  20. }
  21. } finally {
  22. base.Dispose(disposing);
  23. }
  24. #else
  25. return;
  26. #endif
  27. }
  28. protected internal TonemapReinhard(IntPtr addr) : base(addr) { }
  29. // internal usage only
  30. public static new TonemapReinhard __fromPtr__(IntPtr addr) { return new TonemapReinhard(addr); }
  31. //
  32. // C++: float cv::TonemapReinhard::getColorAdaptation()
  33. //
  34. //javadoc: TonemapReinhard::getColorAdaptation()
  35. public float getColorAdaptation() {
  36. ThrowIfDisposed();
  37. #if (UNITY_ANDROID && !UNITY_EDITOR)
  38. float retVal = photo_TonemapReinhard_getColorAdaptation_10(nativeObj);
  39. return retVal;
  40. #else
  41. return -1;
  42. #endif
  43. }
  44. //
  45. // C++: float cv::TonemapReinhard::getIntensity()
  46. //
  47. //javadoc: TonemapReinhard::getIntensity()
  48. public float getIntensity() {
  49. ThrowIfDisposed();
  50. #if (UNITY_ANDROID && !UNITY_EDITOR)
  51. float retVal = photo_TonemapReinhard_getIntensity_10(nativeObj);
  52. return retVal;
  53. #else
  54. return -1;
  55. #endif
  56. }
  57. //
  58. // C++: float cv::TonemapReinhard::getLightAdaptation()
  59. //
  60. //javadoc: TonemapReinhard::getLightAdaptation()
  61. public float getLightAdaptation() {
  62. ThrowIfDisposed();
  63. #if (UNITY_ANDROID && !UNITY_EDITOR)
  64. float retVal = photo_TonemapReinhard_getLightAdaptation_10(nativeObj);
  65. return retVal;
  66. #else
  67. return -1;
  68. #endif
  69. }
  70. //
  71. // C++: void cv::TonemapReinhard::setColorAdaptation(float color_adapt)
  72. //
  73. //javadoc: TonemapReinhard::setColorAdaptation(color_adapt)
  74. public void setColorAdaptation(float color_adapt) {
  75. ThrowIfDisposed();
  76. #if (UNITY_ANDROID && !UNITY_EDITOR)
  77. photo_TonemapReinhard_setColorAdaptation_10(nativeObj, color_adapt);
  78. return;
  79. #else
  80. return;
  81. #endif
  82. }
  83. //
  84. // C++: void cv::TonemapReinhard::setIntensity(float intensity)
  85. //
  86. //javadoc: TonemapReinhard::setIntensity(intensity)
  87. public void setIntensity(float intensity) {
  88. ThrowIfDisposed();
  89. #if (UNITY_ANDROID && !UNITY_EDITOR)
  90. photo_TonemapReinhard_setIntensity_10(nativeObj, intensity);
  91. return;
  92. #else
  93. return;
  94. #endif
  95. }
  96. //
  97. // C++: void cv::TonemapReinhard::setLightAdaptation(float light_adapt)
  98. //
  99. //javadoc: TonemapReinhard::setLightAdaptation(light_adapt)
  100. public void setLightAdaptation(float light_adapt) {
  101. ThrowIfDisposed();
  102. #if (UNITY_ANDROID && !UNITY_EDITOR)
  103. photo_TonemapReinhard_setLightAdaptation_10(nativeObj, light_adapt);
  104. return;
  105. #else
  106. return;
  107. #endif
  108. }
  109. #if (UNITY_ANDROID && !UNITY_EDITOR)
  110. const string LIBNAME = "opencvforunity";
  111. // C++: float cv::TonemapReinhard::getColorAdaptation()
  112. [DllImport(LIBNAME)]
  113. private static extern float photo_TonemapReinhard_getColorAdaptation_10(IntPtr nativeObj);
  114. // C++: float cv::TonemapReinhard::getIntensity()
  115. [DllImport(LIBNAME)]
  116. private static extern float photo_TonemapReinhard_getIntensity_10(IntPtr nativeObj);
  117. // C++: float cv::TonemapReinhard::getLightAdaptation()
  118. [DllImport(LIBNAME)]
  119. private static extern float photo_TonemapReinhard_getLightAdaptation_10(IntPtr nativeObj);
  120. // C++: void cv::TonemapReinhard::setColorAdaptation(float color_adapt)
  121. [DllImport(LIBNAME)]
  122. private static extern void photo_TonemapReinhard_setColorAdaptation_10(IntPtr nativeObj, float color_adapt);
  123. // C++: void cv::TonemapReinhard::setIntensity(float intensity)
  124. [DllImport(LIBNAME)]
  125. private static extern void photo_TonemapReinhard_setIntensity_10(IntPtr nativeObj, float intensity);
  126. // C++: void cv::TonemapReinhard::setLightAdaptation(float light_adapt)
  127. [DllImport(LIBNAME)]
  128. private static extern void photo_TonemapReinhard_setLightAdaptation_10(IntPtr nativeObj, float light_adapt);
  129. // native support for java finalize()
  130. [DllImport(LIBNAME)]
  131. private static extern void photo_TonemapReinhard_delete(IntPtr nativeObj);
  132. #endif
  133. }
  134. }