MergeRobertson.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.PhotoModule
  7. {
  8. // C++: class MergeRobertson
  9. /**
  10. * The resulting HDR image is calculated as weighted average of the exposures considering exposure
  11. * values and camera response.
  12. *
  13. * For more information see CITE: RB99 .
  14. */
  15. public class MergeRobertson : MergeExposures
  16. {
  17. protected override void Dispose(bool disposing)
  18. {
  19. try
  20. {
  21. if (disposing)
  22. {
  23. }
  24. if (IsEnabledDispose)
  25. {
  26. if (nativeObj != IntPtr.Zero)
  27. photo_MergeRobertson_delete(nativeObj);
  28. nativeObj = IntPtr.Zero;
  29. }
  30. }
  31. finally
  32. {
  33. base.Dispose(disposing);
  34. }
  35. }
  36. protected internal MergeRobertson(IntPtr addr) : base(addr) { }
  37. // internal usage only
  38. public static new MergeRobertson __fromPtr__(IntPtr addr) { return new MergeRobertson(addr); }
  39. //
  40. // C++: void cv::MergeRobertson::process(vector_Mat src, Mat& dst, Mat times, Mat response)
  41. //
  42. public override void process(List<Mat> src, Mat dst, Mat times, Mat response)
  43. {
  44. ThrowIfDisposed();
  45. if (dst != null) dst.ThrowIfDisposed();
  46. if (times != null) times.ThrowIfDisposed();
  47. if (response != null) response.ThrowIfDisposed();
  48. Mat src_mat = Converters.vector_Mat_to_Mat(src);
  49. photo_MergeRobertson_process_10(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj, response.nativeObj);
  50. }
  51. //
  52. // C++: void cv::MergeRobertson::process(vector_Mat src, Mat& dst, Mat times)
  53. //
  54. public void process(List<Mat> src, Mat dst, Mat times)
  55. {
  56. ThrowIfDisposed();
  57. if (dst != null) dst.ThrowIfDisposed();
  58. if (times != null) times.ThrowIfDisposed();
  59. Mat src_mat = Converters.vector_Mat_to_Mat(src);
  60. photo_MergeRobertson_process_11(nativeObj, src_mat.nativeObj, dst.nativeObj, times.nativeObj);
  61. }
  62. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  63. const string LIBNAME = "__Internal";
  64. #else
  65. const string LIBNAME = "opencvforunity";
  66. #endif
  67. // C++: void cv::MergeRobertson::process(vector_Mat src, Mat& dst, Mat times, Mat response)
  68. [DllImport(LIBNAME)]
  69. private static extern void photo_MergeRobertson_process_10(IntPtr nativeObj, IntPtr src_mat_nativeObj, IntPtr dst_nativeObj, IntPtr times_nativeObj, IntPtr response_nativeObj);
  70. // C++: void cv::MergeRobertson::process(vector_Mat src, Mat& dst, Mat times)
  71. [DllImport(LIBNAME)]
  72. private static extern void photo_MergeRobertson_process_11(IntPtr nativeObj, IntPtr src_mat_nativeObj, IntPtr dst_nativeObj, IntPtr times_nativeObj);
  73. // native support for java finalize()
  74. [DllImport(LIBNAME)]
  75. private static extern void photo_MergeRobertson_delete(IntPtr nativeObj);
  76. }
  77. }