123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
-
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.ObjdetectModule
- {
- // C++: class QRCodeDetector
- //javadoc: QRCodeDetector
- public class QRCodeDetector : DisposableOpenCVObject
- {
- protected override void Dispose (bool disposing)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
- try {
- if (disposing) {
- }
- if (IsEnabledDispose) {
- if (nativeObj != IntPtr.Zero)
- objdetect_QRCodeDetector_delete(nativeObj);
- nativeObj = IntPtr.Zero;
- }
- } finally {
- base.Dispose (disposing);
- }
- #else
- return;
- #endif
- }
- protected internal QRCodeDetector (IntPtr addr) : base (addr) { }
- public IntPtr getNativeObjAddr () { return nativeObj; }
- // internal usage only
- public static QRCodeDetector __fromPtr__ (IntPtr addr) { return new QRCodeDetector (addr); }
- //
- // C++: cv::QRCodeDetector::QRCodeDetector()
- //
- //javadoc: QRCodeDetector::QRCodeDetector()
- public QRCodeDetector ()
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- nativeObj = objdetect_QRCodeDetector_QRCodeDetector_10();
-
- return;
- #else
- return null;
- #endif
- }
- //
- // C++: bool cv::QRCodeDetector::detect(Mat img, Mat& points)
- //
- //javadoc: QRCodeDetector::detect(img, points)
- public bool detect (Mat img, Mat points)
- {
- ThrowIfDisposed ();
- if (img != null) img.ThrowIfDisposed ();
- if (points != null) points.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- bool retVal = objdetect_QRCodeDetector_detect_10(nativeObj, img.nativeObj, points.nativeObj);
-
- return retVal;
- #else
- return false;
- #endif
- }
- //
- // C++: string cv::QRCodeDetector::decode(Mat img, Mat points, Mat& straight_qrcode = Mat())
- //
- //javadoc: QRCodeDetector::decode(img, points, straight_qrcode)
- public string decode (Mat img, Mat points, Mat straight_qrcode)
- {
- ThrowIfDisposed ();
- if (img != null) img.ThrowIfDisposed ();
- if (points != null) points.ThrowIfDisposed ();
- if (straight_qrcode != null) straight_qrcode.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- string retVal = Marshal.PtrToStringAnsi (objdetect_QRCodeDetector_decode_10(nativeObj, img.nativeObj, points.nativeObj, straight_qrcode.nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: QRCodeDetector::decode(img, points)
- public string decode (Mat img, Mat points)
- {
- ThrowIfDisposed ();
- if (img != null) img.ThrowIfDisposed ();
- if (points != null) points.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- string retVal = Marshal.PtrToStringAnsi (objdetect_QRCodeDetector_decode_11(nativeObj, img.nativeObj, points.nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: string cv::QRCodeDetector::detectAndDecode(Mat img, Mat& points = Mat(), Mat& straight_qrcode = Mat())
- //
- //javadoc: QRCodeDetector::detectAndDecode(img, points, straight_qrcode)
- public string detectAndDecode (Mat img, Mat points, Mat straight_qrcode)
- {
- ThrowIfDisposed ();
- if (img != null) img.ThrowIfDisposed ();
- if (points != null) points.ThrowIfDisposed ();
- if (straight_qrcode != null) straight_qrcode.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- string retVal = Marshal.PtrToStringAnsi (objdetect_QRCodeDetector_detectAndDecode_10(nativeObj, img.nativeObj, points.nativeObj, straight_qrcode.nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: QRCodeDetector::detectAndDecode(img, points)
- public string detectAndDecode (Mat img, Mat points)
- {
- ThrowIfDisposed ();
- if (img != null) img.ThrowIfDisposed ();
- if (points != null) points.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- string retVal = Marshal.PtrToStringAnsi (objdetect_QRCodeDetector_detectAndDecode_11(nativeObj, img.nativeObj, points.nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: QRCodeDetector::detectAndDecode(img)
- public string detectAndDecode (Mat img)
- {
- ThrowIfDisposed ();
- if (img != null) img.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- string retVal = Marshal.PtrToStringAnsi (objdetect_QRCodeDetector_detectAndDecode_12(nativeObj, img.nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: void cv::QRCodeDetector::setEpsX(double epsX)
- //
- //javadoc: QRCodeDetector::setEpsX(epsX)
- public void setEpsX (double epsX)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- objdetect_QRCodeDetector_setEpsX_10(nativeObj, epsX);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: void cv::QRCodeDetector::setEpsY(double epsY)
- //
- //javadoc: QRCodeDetector::setEpsY(epsY)
- public void setEpsY (double epsY)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- objdetect_QRCodeDetector_setEpsY_10(nativeObj, epsY);
-
- return;
- #else
- return;
- #endif
- }
- #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
- const string LIBNAME = "__Internal";
- #else
- const string LIBNAME = "opencvforunity";
- #endif
- // C++: cv::QRCodeDetector::QRCodeDetector()
- [DllImport (LIBNAME)]
- private static extern IntPtr objdetect_QRCodeDetector_QRCodeDetector_10 ();
- // C++: bool cv::QRCodeDetector::detect(Mat img, Mat& points)
- [DllImport (LIBNAME)]
- private static extern bool objdetect_QRCodeDetector_detect_10 (IntPtr nativeObj, IntPtr img_nativeObj, IntPtr points_nativeObj);
- // C++: string cv::QRCodeDetector::decode(Mat img, Mat points, Mat& straight_qrcode = Mat())
- [DllImport (LIBNAME)]
- private static extern IntPtr objdetect_QRCodeDetector_decode_10 (IntPtr nativeObj, IntPtr img_nativeObj, IntPtr points_nativeObj, IntPtr straight_qrcode_nativeObj);
- [DllImport (LIBNAME)]
- private static extern IntPtr objdetect_QRCodeDetector_decode_11 (IntPtr nativeObj, IntPtr img_nativeObj, IntPtr points_nativeObj);
- // C++: string cv::QRCodeDetector::detectAndDecode(Mat img, Mat& points = Mat(), Mat& straight_qrcode = Mat())
- [DllImport (LIBNAME)]
- private static extern IntPtr objdetect_QRCodeDetector_detectAndDecode_10 (IntPtr nativeObj, IntPtr img_nativeObj, IntPtr points_nativeObj, IntPtr straight_qrcode_nativeObj);
- [DllImport (LIBNAME)]
- private static extern IntPtr objdetect_QRCodeDetector_detectAndDecode_11 (IntPtr nativeObj, IntPtr img_nativeObj, IntPtr points_nativeObj);
- [DllImport (LIBNAME)]
- private static extern IntPtr objdetect_QRCodeDetector_detectAndDecode_12 (IntPtr nativeObj, IntPtr img_nativeObj);
- // C++: void cv::QRCodeDetector::setEpsX(double epsX)
- [DllImport (LIBNAME)]
- private static extern void objdetect_QRCodeDetector_setEpsX_10 (IntPtr nativeObj, double epsX);
- // C++: void cv::QRCodeDetector::setEpsY(double epsY)
- [DllImport (LIBNAME)]
- private static extern void objdetect_QRCodeDetector_setEpsY_10 (IntPtr nativeObj, double epsY);
- // native support for java finalize()
- [DllImport (LIBNAME)]
- private static extern void objdetect_QRCodeDetector_delete (IntPtr nativeObj);
- }
- }
|