123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
-
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.ArucoModule
- {
- // C++: class Dictionary
- //javadoc: Dictionary
- public class Dictionary : 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)
- aruco_Dictionary_delete(nativeObj);
- nativeObj = IntPtr.Zero;
- }
- } finally {
- base.Dispose (disposing);
- }
- #else
- return;
- #endif
- }
- protected internal Dictionary (IntPtr addr) : base (addr) { }
- public IntPtr getNativeObjAddr () { return nativeObj; }
- // internal usage only
- public static Dictionary __fromPtr__ (IntPtr addr) { return new Dictionary (addr); }
- //
- // C++: static Mat cv::aruco::Dictionary::getBitsFromByteList(Mat byteList, int markerSize)
- //
- //javadoc: Dictionary::getBitsFromByteList(byteList, markerSize)
- public static Mat getBitsFromByteList (Mat byteList, int markerSize)
- {
- if (byteList != null) byteList.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- Mat retVal = new Mat(aruco_Dictionary_getBitsFromByteList_10(byteList.nativeObj, markerSize));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: static Mat cv::aruco::Dictionary::getByteListFromBits(Mat bits)
- //
- //javadoc: Dictionary::getByteListFromBits(bits)
- public static Mat getByteListFromBits (Mat bits)
- {
- if (bits != null) bits.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- Mat retVal = new Mat(aruco_Dictionary_getByteListFromBits_10(bits.nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: static Ptr_Dictionary cv::aruco::Dictionary::create(int nMarkers, int markerSize, Ptr_Dictionary baseDictionary, int randomSeed = 0)
- //
- //javadoc: Dictionary::create_from(nMarkers, markerSize, baseDictionary, randomSeed)
- public static Dictionary create_from (int nMarkers, int markerSize, Dictionary baseDictionary, int randomSeed)
- {
- if (baseDictionary != null) baseDictionary.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- Dictionary retVal = Dictionary.__fromPtr__(aruco_Dictionary_create_1from_10(nMarkers, markerSize, baseDictionary.getNativeObjAddr(), randomSeed));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: Dictionary::create_from(nMarkers, markerSize, baseDictionary)
- public static Dictionary create_from (int nMarkers, int markerSize, Dictionary baseDictionary)
- {
- if (baseDictionary != null) baseDictionary.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- Dictionary retVal = Dictionary.__fromPtr__(aruco_Dictionary_create_1from_11(nMarkers, markerSize, baseDictionary.getNativeObjAddr()));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: static Ptr_Dictionary cv::aruco::Dictionary::create(int nMarkers, int markerSize, int randomSeed = 0)
- //
- //javadoc: Dictionary::create(nMarkers, markerSize, randomSeed)
- public static Dictionary create (int nMarkers, int markerSize, int randomSeed)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- Dictionary retVal = Dictionary.__fromPtr__(aruco_Dictionary_create_10(nMarkers, markerSize, randomSeed));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: Dictionary::create(nMarkers, markerSize)
- public static Dictionary create (int nMarkers, int markerSize)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- Dictionary retVal = Dictionary.__fromPtr__(aruco_Dictionary_create_11(nMarkers, markerSize));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: static Ptr_Dictionary cv::aruco::Dictionary::get(int dict)
- //
- //javadoc: Dictionary::get(dict)
- public static Dictionary get (int dict)
- {
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- Dictionary retVal = Dictionary.__fromPtr__(aruco_Dictionary_get_10(dict));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: void cv::aruco::Dictionary::drawMarker(int id, int sidePixels, Mat& _img, int borderBits = 1)
- //
- //javadoc: Dictionary::drawMarker(id, sidePixels, _img, borderBits)
- public void drawMarker (int id, int sidePixels, Mat _img, int borderBits)
- {
- ThrowIfDisposed ();
- if (_img != null) _img.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- aruco_Dictionary_drawMarker_10(nativeObj, id, sidePixels, _img.nativeObj, borderBits);
-
- return;
- #else
- return;
- #endif
- }
- //javadoc: Dictionary::drawMarker(id, sidePixels, _img)
- public void drawMarker (int id, int sidePixels, Mat _img)
- {
- ThrowIfDisposed ();
- if (_img != null) _img.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- aruco_Dictionary_drawMarker_11(nativeObj, id, sidePixels, _img.nativeObj);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: Mat Dictionary::bytesList
- //
- //javadoc: Dictionary::get_bytesList()
- public Mat get_bytesList ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- Mat retVal = new Mat(aruco_Dictionary_get_1bytesList_10(nativeObj));
-
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: void Dictionary::bytesList
- //
- //javadoc: Dictionary::set_bytesList(bytesList)
- public void set_bytesList (Mat bytesList)
- {
- ThrowIfDisposed ();
- if (bytesList != null) bytesList.ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- aruco_Dictionary_set_1bytesList_10(nativeObj, bytesList.nativeObj);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: int Dictionary::markerSize
- //
- //javadoc: Dictionary::get_markerSize()
- public int get_markerSize ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = aruco_Dictionary_get_1markerSize_10(nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: void Dictionary::markerSize
- //
- //javadoc: Dictionary::set_markerSize(markerSize)
- public void set_markerSize (int markerSize)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- aruco_Dictionary_set_1markerSize_10(nativeObj, markerSize);
-
- return;
- #else
- return;
- #endif
- }
- //
- // C++: int Dictionary::maxCorrectionBits
- //
- //javadoc: Dictionary::get_maxCorrectionBits()
- public int get_maxCorrectionBits ()
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- int retVal = aruco_Dictionary_get_1maxCorrectionBits_10(nativeObj);
-
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: void Dictionary::maxCorrectionBits
- //
- //javadoc: Dictionary::set_maxCorrectionBits(maxCorrectionBits)
- public void set_maxCorrectionBits (int maxCorrectionBits)
- {
- ThrowIfDisposed ();
- #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
-
- aruco_Dictionary_set_1maxCorrectionBits_10(nativeObj, maxCorrectionBits);
-
- return;
- #else
- return;
- #endif
- }
- #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
- const string LIBNAME = "__Internal";
- #else
- const string LIBNAME = "opencvforunity";
- #endif
- // C++: static Mat cv::aruco::Dictionary::getBitsFromByteList(Mat byteList, int markerSize)
- [DllImport (LIBNAME)]
- private static extern IntPtr aruco_Dictionary_getBitsFromByteList_10 (IntPtr byteList_nativeObj, int markerSize);
- // C++: static Mat cv::aruco::Dictionary::getByteListFromBits(Mat bits)
- [DllImport (LIBNAME)]
- private static extern IntPtr aruco_Dictionary_getByteListFromBits_10 (IntPtr bits_nativeObj);
- // C++: static Ptr_Dictionary cv::aruco::Dictionary::create(int nMarkers, int markerSize, Ptr_Dictionary baseDictionary, int randomSeed = 0)
- [DllImport (LIBNAME)]
- private static extern IntPtr aruco_Dictionary_create_1from_10 (int nMarkers, int markerSize, IntPtr baseDictionary_nativeObj, int randomSeed);
- [DllImport (LIBNAME)]
- private static extern IntPtr aruco_Dictionary_create_1from_11 (int nMarkers, int markerSize, IntPtr baseDictionary_nativeObj);
- // C++: static Ptr_Dictionary cv::aruco::Dictionary::create(int nMarkers, int markerSize, int randomSeed = 0)
- [DllImport (LIBNAME)]
- private static extern IntPtr aruco_Dictionary_create_10 (int nMarkers, int markerSize, int randomSeed);
- [DllImport (LIBNAME)]
- private static extern IntPtr aruco_Dictionary_create_11 (int nMarkers, int markerSize);
- // C++: static Ptr_Dictionary cv::aruco::Dictionary::get(int dict)
- [DllImport (LIBNAME)]
- private static extern IntPtr aruco_Dictionary_get_10 (int dict);
- // C++: void cv::aruco::Dictionary::drawMarker(int id, int sidePixels, Mat& _img, int borderBits = 1)
- [DllImport (LIBNAME)]
- private static extern void aruco_Dictionary_drawMarker_10 (IntPtr nativeObj, int id, int sidePixels, IntPtr _img_nativeObj, int borderBits);
- [DllImport (LIBNAME)]
- private static extern void aruco_Dictionary_drawMarker_11 (IntPtr nativeObj, int id, int sidePixels, IntPtr _img_nativeObj);
- // C++: Mat Dictionary::bytesList
- [DllImport (LIBNAME)]
- private static extern IntPtr aruco_Dictionary_get_1bytesList_10 (IntPtr nativeObj);
- // C++: void Dictionary::bytesList
- [DllImport (LIBNAME)]
- private static extern void aruco_Dictionary_set_1bytesList_10 (IntPtr nativeObj, IntPtr bytesList_nativeObj);
- // C++: int Dictionary::markerSize
- [DllImport (LIBNAME)]
- private static extern int aruco_Dictionary_get_1markerSize_10 (IntPtr nativeObj);
- // C++: void Dictionary::markerSize
- [DllImport (LIBNAME)]
- private static extern void aruco_Dictionary_set_1markerSize_10 (IntPtr nativeObj, int markerSize);
- // C++: int Dictionary::maxCorrectionBits
- [DllImport (LIBNAME)]
- private static extern int aruco_Dictionary_get_1maxCorrectionBits_10 (IntPtr nativeObj);
- // C++: void Dictionary::maxCorrectionBits
- [DllImport (LIBNAME)]
- private static extern void aruco_Dictionary_set_1maxCorrectionBits_10 (IntPtr nativeObj, int maxCorrectionBits);
- // native support for java finalize()
- [DllImport (LIBNAME)]
- private static extern void aruco_Dictionary_delete (IntPtr nativeObj);
- }
- }
|