TonemapMantiuk.cs 3.5 KB

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