AlignExposures.cs 2.4 KB

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