RetinaFastToneMapping.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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.BioinspiredModule
  8. {
  9. // C++: class RetinaFastToneMapping
  10. //javadoc: RetinaFastToneMapping
  11. public class RetinaFastToneMapping : Algorithm
  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. bioinspired_RetinaFastToneMapping_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal RetinaFastToneMapping (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new RetinaFastToneMapping __fromPtr__ (IntPtr addr) { return new RetinaFastToneMapping (addr); }
  34. //
  35. // C++: static Ptr_RetinaFastToneMapping cv::bioinspired::RetinaFastToneMapping::create(Size inputSize)
  36. //
  37. //javadoc: RetinaFastToneMapping::create(inputSize)
  38. public static RetinaFastToneMapping create (Size inputSize)
  39. {
  40. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  41. RetinaFastToneMapping retVal = RetinaFastToneMapping.__fromPtr__(bioinspired_RetinaFastToneMapping_create_10(inputSize.width, inputSize.height));
  42. return retVal;
  43. #else
  44. return null;
  45. #endif
  46. }
  47. //
  48. // C++: void cv::bioinspired::RetinaFastToneMapping::applyFastToneMapping(Mat inputImage, Mat& outputToneMappedImage)
  49. //
  50. //javadoc: RetinaFastToneMapping::applyFastToneMapping(inputImage, outputToneMappedImage)
  51. public void applyFastToneMapping (Mat inputImage, Mat outputToneMappedImage)
  52. {
  53. ThrowIfDisposed ();
  54. if (inputImage != null) inputImage.ThrowIfDisposed ();
  55. if (outputToneMappedImage != null) outputToneMappedImage.ThrowIfDisposed ();
  56. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  57. bioinspired_RetinaFastToneMapping_applyFastToneMapping_10(nativeObj, inputImage.nativeObj, outputToneMappedImage.nativeObj);
  58. return;
  59. #else
  60. return;
  61. #endif
  62. }
  63. //
  64. // C++: void cv::bioinspired::RetinaFastToneMapping::setup(float photoreceptorsNeighborhoodRadius = 3.f, float ganglioncellsNeighborhoodRadius = 1.f, float meanLuminanceModulatorK = 1.f)
  65. //
  66. //javadoc: RetinaFastToneMapping::setup(photoreceptorsNeighborhoodRadius, ganglioncellsNeighborhoodRadius, meanLuminanceModulatorK)
  67. public void setup (float photoreceptorsNeighborhoodRadius, float ganglioncellsNeighborhoodRadius, float meanLuminanceModulatorK)
  68. {
  69. ThrowIfDisposed ();
  70. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  71. bioinspired_RetinaFastToneMapping_setup_10(nativeObj, photoreceptorsNeighborhoodRadius, ganglioncellsNeighborhoodRadius, meanLuminanceModulatorK);
  72. return;
  73. #else
  74. return;
  75. #endif
  76. }
  77. //javadoc: RetinaFastToneMapping::setup(photoreceptorsNeighborhoodRadius, ganglioncellsNeighborhoodRadius)
  78. public void setup (float photoreceptorsNeighborhoodRadius, float ganglioncellsNeighborhoodRadius)
  79. {
  80. ThrowIfDisposed ();
  81. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  82. bioinspired_RetinaFastToneMapping_setup_11(nativeObj, photoreceptorsNeighborhoodRadius, ganglioncellsNeighborhoodRadius);
  83. return;
  84. #else
  85. return;
  86. #endif
  87. }
  88. //javadoc: RetinaFastToneMapping::setup(photoreceptorsNeighborhoodRadius)
  89. public void setup (float photoreceptorsNeighborhoodRadius)
  90. {
  91. ThrowIfDisposed ();
  92. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  93. bioinspired_RetinaFastToneMapping_setup_12(nativeObj, photoreceptorsNeighborhoodRadius);
  94. return;
  95. #else
  96. return;
  97. #endif
  98. }
  99. //javadoc: RetinaFastToneMapping::setup()
  100. public void setup ()
  101. {
  102. ThrowIfDisposed ();
  103. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  104. bioinspired_RetinaFastToneMapping_setup_13(nativeObj);
  105. return;
  106. #else
  107. return;
  108. #endif
  109. }
  110. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  111. const string LIBNAME = "__Internal";
  112. #else
  113. const string LIBNAME = "opencvforunity";
  114. #endif
  115. // C++: static Ptr_RetinaFastToneMapping cv::bioinspired::RetinaFastToneMapping::create(Size inputSize)
  116. [DllImport (LIBNAME)]
  117. private static extern IntPtr bioinspired_RetinaFastToneMapping_create_10 (double inputSize_width, double inputSize_height);
  118. // C++: void cv::bioinspired::RetinaFastToneMapping::applyFastToneMapping(Mat inputImage, Mat& outputToneMappedImage)
  119. [DllImport (LIBNAME)]
  120. private static extern void bioinspired_RetinaFastToneMapping_applyFastToneMapping_10 (IntPtr nativeObj, IntPtr inputImage_nativeObj, IntPtr outputToneMappedImage_nativeObj);
  121. // C++: void cv::bioinspired::RetinaFastToneMapping::setup(float photoreceptorsNeighborhoodRadius = 3.f, float ganglioncellsNeighborhoodRadius = 1.f, float meanLuminanceModulatorK = 1.f)
  122. [DllImport (LIBNAME)]
  123. private static extern void bioinspired_RetinaFastToneMapping_setup_10 (IntPtr nativeObj, float photoreceptorsNeighborhoodRadius, float ganglioncellsNeighborhoodRadius, float meanLuminanceModulatorK);
  124. [DllImport (LIBNAME)]
  125. private static extern void bioinspired_RetinaFastToneMapping_setup_11 (IntPtr nativeObj, float photoreceptorsNeighborhoodRadius, float ganglioncellsNeighborhoodRadius);
  126. [DllImport (LIBNAME)]
  127. private static extern void bioinspired_RetinaFastToneMapping_setup_12 (IntPtr nativeObj, float photoreceptorsNeighborhoodRadius);
  128. [DllImport (LIBNAME)]
  129. private static extern void bioinspired_RetinaFastToneMapping_setup_13 (IntPtr nativeObj);
  130. // native support for java finalize()
  131. [DllImport (LIBNAME)]
  132. private static extern void bioinspired_RetinaFastToneMapping_delete (IntPtr nativeObj);
  133. }
  134. }