123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318 |
-
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.PhotoModule {
- // C++: class AlignMTB
- //javadoc: AlignMTB
- public class AlignMTB : AlignExposures {
- protected override void Dispose(bool disposing) {
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- try {
- if (disposing) {
- }
- if (IsEnabledDispose) {
- if (nativeObj != IntPtr.Zero)
- photo_AlignMTB_delete(nativeObj);
- nativeObj = IntPtr.Zero;
- }
- } finally {
- base.Dispose(disposing);
- }
- #else
- return;
- #endif
- }
- protected internal AlignMTB(IntPtr addr)
- : base(addr) {
- }
- // internal usage only
- public static new AlignMTB __fromPtr__(IntPtr addr) {
- return new AlignMTB(addr);
- }
- //
- // C++: Point cv::AlignMTB::calculateShift(Mat img0, Mat img1)
- //
- //javadoc: AlignMTB::calculateShift(img0, img1)
- public Point calculateShift(Mat img0, Mat img1) {
- ThrowIfDisposed();
- if (img0 != null)
- img0.ThrowIfDisposed();
- if (img1 != null)
- img1.ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- double[] tmpArray = new double[2];
- photo_AlignMTB_calculateShift_10(nativeObj, img0.nativeObj, img1.nativeObj, tmpArray);
- Point retVal = new Point(tmpArray);
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: bool cv::AlignMTB::getCut()
- //
- //javadoc: AlignMTB::getCut()
- public bool getCut() {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- bool retVal = photo_AlignMTB_getCut_10(nativeObj);
- return retVal;
- #else
- return false;
- #endif
- }
- //
- // C++: int cv::AlignMTB::getExcludeRange()
- //
- //javadoc: AlignMTB::getExcludeRange()
- public int getExcludeRange() {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- int retVal = photo_AlignMTB_getExcludeRange_10(nativeObj);
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: int cv::AlignMTB::getMaxBits()
- //
- //javadoc: AlignMTB::getMaxBits()
- public int getMaxBits() {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- int retVal = photo_AlignMTB_getMaxBits_10(nativeObj);
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: void cv::AlignMTB::computeBitmaps(Mat img, Mat& tb, Mat& eb)
- //
- //javadoc: AlignMTB::computeBitmaps(img, tb, eb)
- public void computeBitmaps(Mat img, Mat tb, Mat eb) {
- ThrowIfDisposed();
- if (img != null)
- img.ThrowIfDisposed();
- if (tb != null)
- tb.ThrowIfDisposed();
- if (eb != null)
- eb.ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- photo_AlignMTB_computeBitmaps_10(nativeObj, img.nativeObj, tb.nativeObj, eb.nativeObj);
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::AlignMTB::process(vector_Mat src, vector_Mat dst, Mat times, Mat response)
- //
- //javadoc: AlignMTB::process(src, dst, times, response)
- public override void process(List<Mat> src, List<Mat> dst, Mat times, Mat response) {
- ThrowIfDisposed();
- if (times != null)
- times.ThrowIfDisposed();
- if (response != null)
- response.ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- Mat src_mat = Converters.vector_Mat_to_Mat(src);
- Mat dst_mat = Converters.vector_Mat_to_Mat(dst);
- photo_AlignMTB_process_10(nativeObj, src_mat.nativeObj, dst_mat.nativeObj, times.nativeObj, response.nativeObj);
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::AlignMTB::process(vector_Mat src, vector_Mat dst)
- //
- //javadoc: AlignMTB::process(src, dst)
- public void process(List<Mat> src, List<Mat> dst) {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- Mat src_mat = Converters.vector_Mat_to_Mat(src);
- Mat dst_mat = Converters.vector_Mat_to_Mat(dst);
- photo_AlignMTB_process_11(nativeObj, src_mat.nativeObj, dst_mat.nativeObj);
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::AlignMTB::setCut(bool value)
- //
- //javadoc: AlignMTB::setCut(value)
- public void setCut(bool value) {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- photo_AlignMTB_setCut_10(nativeObj, value);
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::AlignMTB::setExcludeRange(int exclude_range)
- //
- //javadoc: AlignMTB::setExcludeRange(exclude_range)
- public void setExcludeRange(int exclude_range) {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- photo_AlignMTB_setExcludeRange_10(nativeObj, exclude_range);
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::AlignMTB::setMaxBits(int max_bits)
- //
- //javadoc: AlignMTB::setMaxBits(max_bits)
- public void setMaxBits(int max_bits) {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- photo_AlignMTB_setMaxBits_10(nativeObj, max_bits);
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::AlignMTB::shiftMat(Mat src, Mat& dst, Point shift)
- //
- //javadoc: AlignMTB::shiftMat(src, dst, shift)
- public void shiftMat(Mat src, Mat dst, Point shift) {
- ThrowIfDisposed();
- if (src != null)
- src.ThrowIfDisposed();
- if (dst != null)
- dst.ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- photo_AlignMTB_shiftMat_10(nativeObj, src.nativeObj, dst.nativeObj, shift.x, shift.y);
- return;
- #else
- return;
- #endif
- }
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- const string LIBNAME = "opencvforunity";
- // C++: Point cv::AlignMTB::calculateShift(Mat img0, Mat img1)
- [DllImport(LIBNAME)]
- private static extern void photo_AlignMTB_calculateShift_10(IntPtr nativeObj, IntPtr img0_nativeObj, IntPtr img1_nativeObj, double[] retVal);
- // C++: bool cv::AlignMTB::getCut()
- [DllImport(LIBNAME)]
- private static extern bool photo_AlignMTB_getCut_10(IntPtr nativeObj);
- // C++: int cv::AlignMTB::getExcludeRange()
- [DllImport(LIBNAME)]
- private static extern int photo_AlignMTB_getExcludeRange_10(IntPtr nativeObj);
- // C++: int cv::AlignMTB::getMaxBits()
- [DllImport(LIBNAME)]
- private static extern int photo_AlignMTB_getMaxBits_10(IntPtr nativeObj);
- // C++: void cv::AlignMTB::computeBitmaps(Mat img, Mat& tb, Mat& eb)
- [DllImport(LIBNAME)]
- private static extern void photo_AlignMTB_computeBitmaps_10(IntPtr nativeObj, IntPtr img_nativeObj, IntPtr tb_nativeObj, IntPtr eb_nativeObj);
- // C++: void cv::AlignMTB::process(vector_Mat src, vector_Mat dst, Mat times, Mat response)
- [DllImport(LIBNAME)]
- private static extern void photo_AlignMTB_process_10(IntPtr nativeObj, IntPtr src_mat_nativeObj, IntPtr dst_mat_nativeObj, IntPtr times_nativeObj, IntPtr response_nativeObj);
- // C++: void cv::AlignMTB::process(vector_Mat src, vector_Mat dst)
- [DllImport(LIBNAME)]
- private static extern void photo_AlignMTB_process_11(IntPtr nativeObj, IntPtr src_mat_nativeObj, IntPtr dst_mat_nativeObj);
- // C++: void cv::AlignMTB::setCut(bool value)
- [DllImport(LIBNAME)]
- private static extern void photo_AlignMTB_setCut_10(IntPtr nativeObj, bool value);
- // C++: void cv::AlignMTB::setExcludeRange(int exclude_range)
- [DllImport(LIBNAME)]
- private static extern void photo_AlignMTB_setExcludeRange_10(IntPtr nativeObj, int exclude_range);
- // C++: void cv::AlignMTB::setMaxBits(int max_bits)
- [DllImport(LIBNAME)]
- private static extern void photo_AlignMTB_setMaxBits_10(IntPtr nativeObj, int max_bits);
- // C++: void cv::AlignMTB::shiftMat(Mat src, Mat& dst, Point shift)
- [DllImport(LIBNAME)]
- private static extern void photo_AlignMTB_shiftMat_10(IntPtr nativeObj, IntPtr src_nativeObj, IntPtr dst_nativeObj, double shift_x, double shift_y);
- // native support for java finalize()
- [DllImport(LIBNAME)]
- private static extern void photo_AlignMTB_delete(IntPtr nativeObj);
- #endif
- }
- }
|