TonemapMantiuk.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. {
  9. // C++: class TonemapMantiuk
  10. //javadoc: TonemapMantiuk
  11. public class TonemapMantiuk : Tonemap
  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. photo_TonemapMantiuk_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal TonemapMantiuk (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new TonemapMantiuk __fromPtr__ (IntPtr addr) { return new TonemapMantiuk (addr); }
  34. //
  35. // C++: float cv::TonemapMantiuk::getSaturation()
  36. //
  37. //javadoc: TonemapMantiuk::getSaturation()
  38. public float getSaturation ()
  39. {
  40. ThrowIfDisposed ();
  41. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  42. float retVal = photo_TonemapMantiuk_getSaturation_10(nativeObj);
  43. return retVal;
  44. #else
  45. return -1;
  46. #endif
  47. }
  48. //
  49. // C++: float cv::TonemapMantiuk::getScale()
  50. //
  51. //javadoc: TonemapMantiuk::getScale()
  52. public float getScale ()
  53. {
  54. ThrowIfDisposed ();
  55. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  56. float retVal = photo_TonemapMantiuk_getScale_10(nativeObj);
  57. return retVal;
  58. #else
  59. return -1;
  60. #endif
  61. }
  62. //
  63. // C++: void cv::TonemapMantiuk::setSaturation(float saturation)
  64. //
  65. //javadoc: TonemapMantiuk::setSaturation(saturation)
  66. public void setSaturation (float saturation)
  67. {
  68. ThrowIfDisposed ();
  69. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  70. photo_TonemapMantiuk_setSaturation_10(nativeObj, saturation);
  71. return;
  72. #else
  73. return;
  74. #endif
  75. }
  76. //
  77. // C++: void cv::TonemapMantiuk::setScale(float scale)
  78. //
  79. //javadoc: TonemapMantiuk::setScale(scale)
  80. public void setScale (float scale)
  81. {
  82. ThrowIfDisposed ();
  83. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  84. photo_TonemapMantiuk_setScale_10(nativeObj, scale);
  85. return;
  86. #else
  87. return;
  88. #endif
  89. }
  90. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  91. const string LIBNAME = "__Internal";
  92. #else
  93. const string LIBNAME = "opencvforunity";
  94. #endif
  95. // C++: float cv::TonemapMantiuk::getSaturation()
  96. [DllImport (LIBNAME)]
  97. private static extern float photo_TonemapMantiuk_getSaturation_10 (IntPtr nativeObj);
  98. // C++: float cv::TonemapMantiuk::getScale()
  99. [DllImport (LIBNAME)]
  100. private static extern float photo_TonemapMantiuk_getScale_10 (IntPtr nativeObj);
  101. // C++: void cv::TonemapMantiuk::setSaturation(float saturation)
  102. [DllImport (LIBNAME)]
  103. private static extern void photo_TonemapMantiuk_setSaturation_10 (IntPtr nativeObj, float saturation);
  104. // C++: void cv::TonemapMantiuk::setScale(float scale)
  105. [DllImport (LIBNAME)]
  106. private static extern void photo_TonemapMantiuk_setScale_10 (IntPtr nativeObj, float scale);
  107. // native support for java finalize()
  108. [DllImport (LIBNAME)]
  109. private static extern void photo_TonemapMantiuk_delete (IntPtr nativeObj);
  110. }
  111. }