MergeExposures.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 MergeExposures
  10. //javadoc: MergeExposures
  11. public class MergeExposures : 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. photo_MergeExposures_delete (nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal MergeExposures (IntPtr addr)
  32. : base (addr)
  33. {
  34. }
  35. // internal usage only
  36. public static new MergeExposures __fromPtr__ (IntPtr addr)
  37. {
  38. return new MergeExposures (addr);
  39. }
  40. //
  41. // C++: void cv::MergeExposures::process(vector_Mat src, Mat& dst, Mat times, Mat response)
  42. //
  43. //javadoc: MergeExposures::process(src, dst, times, response)
  44. public virtual void process (List<Mat> src, Mat dst, Mat times, Mat response)
  45. {
  46. ThrowIfDisposed ();
  47. if (dst != null)
  48. dst.ThrowIfDisposed ();
  49. if (times != null)
  50. times.ThrowIfDisposed ();
  51. if (response != null)
  52. response.ThrowIfDisposed ();
  53. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  54. Mat src_mat = Converters.vector_Mat_to_Mat (src);
  55. photo_MergeExposures_process_10 (nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj);
  56. return;
  57. #else
  58. return;
  59. #endif
  60. }
  61. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  62. const string LIBNAME = "__Internal";
  63. #else
  64. const string LIBNAME = "opencvforunity";
  65. #endif
  66. // C++: void cv::MergeExposures::process(vector_Mat src, Mat& dst, Mat times, Mat response)
  67. [DllImport (LIBNAME)]
  68. private static extern void photo_MergeExposures_process_10 (IntPtr nativeObj, IntPtr src_mat_nativeObj, IntPtr dst_nativeObj, IntPtr times_nativeObj, IntPtr response_nativeObj);
  69. // native support for java finalize()
  70. [DllImport (LIBNAME)]
  71. private static extern void photo_MergeExposures_delete (IntPtr nativeObj);
  72. }
  73. }