MergeExposures.cs 2.4 KB

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