AlignExposures.cs 2.7 KB

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