123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- #if !UNITY_WSA_10_0
- using OpenCVForUnity.CoreModule;
- using OpenCVForUnity.UtilsModule;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace OpenCVForUnity.DnnModule {
- // C++: class DictValue
- //javadoc: DictValue
- public class DictValue : DisposableOpenCVObject {
- protected override void Dispose(bool disposing) {
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- try {
- if (disposing) {
- }
- if (IsEnabledDispose) {
- if (nativeObj != IntPtr.Zero)
- dnn_DictValue_delete(nativeObj);
- nativeObj = IntPtr.Zero;
- }
- } finally {
- base.Dispose(disposing);
- }
- #else
- return;
- #endif
- }
- protected internal DictValue(IntPtr addr)
- : base(addr) {
- }
- public IntPtr getNativeObjAddr() {
- return nativeObj;
- }
- // internal usage only
- public static DictValue __fromPtr__(IntPtr addr) {
- return new DictValue(addr);
- }
- //
- // C++: cv::dnn::DictValue::DictValue(String s)
- //
- //javadoc: DictValue::DictValue(s)
- public DictValue(string s) {
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- nativeObj = dnn_DictValue_DictValue_10(s);
- return;
- #else
- return;
- #endif
- }
- //
- // C++: cv::dnn::DictValue::DictValue(double p)
- //
- //javadoc: DictValue::DictValue(p)
- public DictValue(double p) {
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- nativeObj = dnn_DictValue_DictValue_11(p);
- return;
- #else
- return;
- #endif
- }
- //
- // C++: cv::dnn::DictValue::DictValue(int i)
- //
- //javadoc: DictValue::DictValue(i)
- public DictValue(int i) {
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- nativeObj = dnn_DictValue_DictValue_12(i);
- return;
- #else
- return;
- #endif
- }
- //
- // C++: String cv::dnn::DictValue::getStringValue(int idx = -1)
- //
- //javadoc: DictValue::getStringValue(idx)
- public string getStringValue(int idx) {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- string retVal = Marshal.PtrToStringAnsi(dnn_DictValue_getStringValue_10(nativeObj, idx));
- return retVal;
- #else
- return null;
- #endif
- }
- //javadoc: DictValue::getStringValue()
- public string getStringValue() {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- string retVal = Marshal.PtrToStringAnsi(dnn_DictValue_getStringValue_11(nativeObj));
- return retVal;
- #else
- return null;
- #endif
- }
- //
- // C++: bool cv::dnn::DictValue::isInt()
- //
- //javadoc: DictValue::isInt()
- public bool isInt() {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- bool retVal = dnn_DictValue_isInt_10(nativeObj);
- return retVal;
- #else
- return false;
- #endif
- }
- //
- // C++: bool cv::dnn::DictValue::isReal()
- //
- //javadoc: DictValue::isReal()
- public bool isReal() {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- bool retVal = dnn_DictValue_isReal_10(nativeObj);
- return retVal;
- #else
- return false;
- #endif
- }
- //
- // C++: bool cv::dnn::DictValue::isString()
- //
- //javadoc: DictValue::isString()
- public bool isString() {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- bool retVal = dnn_DictValue_isString_10(nativeObj);
- return retVal;
- #else
- return false;
- #endif
- }
- //
- // C++: double cv::dnn::DictValue::getRealValue(int idx = -1)
- //
- //javadoc: DictValue::getRealValue(idx)
- public double getRealValue(int idx) {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- double retVal = dnn_DictValue_getRealValue_10(nativeObj, idx);
- return retVal;
- #else
- return -1;
- #endif
- }
- //javadoc: DictValue::getRealValue()
- public double getRealValue() {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- double retVal = dnn_DictValue_getRealValue_11(nativeObj);
- return retVal;
- #else
- return -1;
- #endif
- }
- //
- // C++: int cv::dnn::DictValue::getIntValue(int idx = -1)
- //
- //javadoc: DictValue::getIntValue(idx)
- public int getIntValue(int idx) {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- int retVal = dnn_DictValue_getIntValue_10(nativeObj, idx);
- return retVal;
- #else
- return -1;
- #endif
- }
- //javadoc: DictValue::getIntValue()
- public int getIntValue() {
- ThrowIfDisposed();
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- int retVal = dnn_DictValue_getIntValue_11(nativeObj);
- return retVal;
- #else
- return -1;
- #endif
- }
- #if (UNITY_ANDROID && !UNITY_EDITOR)
- const string LIBNAME = "opencvforunity";
- // C++: cv::dnn::DictValue::DictValue(String s)
- [DllImport(LIBNAME)]
- private static extern IntPtr dnn_DictValue_DictValue_10(string s);
- // C++: cv::dnn::DictValue::DictValue(double p)
- [DllImport(LIBNAME)]
- private static extern IntPtr dnn_DictValue_DictValue_11(double p);
- // C++: cv::dnn::DictValue::DictValue(int i)
- [DllImport(LIBNAME)]
- private static extern IntPtr dnn_DictValue_DictValue_12(int i);
- // C++: String cv::dnn::DictValue::getStringValue(int idx = -1)
- [DllImport(LIBNAME)]
- private static extern IntPtr dnn_DictValue_getStringValue_10(IntPtr nativeObj, int idx);
- [DllImport(LIBNAME)]
- private static extern IntPtr dnn_DictValue_getStringValue_11(IntPtr nativeObj);
- // C++: bool cv::dnn::DictValue::isInt()
- [DllImport(LIBNAME)]
- private static extern bool dnn_DictValue_isInt_10(IntPtr nativeObj);
- // C++: bool cv::dnn::DictValue::isReal()
- [DllImport(LIBNAME)]
- private static extern bool dnn_DictValue_isReal_10(IntPtr nativeObj);
- // C++: bool cv::dnn::DictValue::isString()
- [DllImport(LIBNAME)]
- private static extern bool dnn_DictValue_isString_10(IntPtr nativeObj);
- // C++: double cv::dnn::DictValue::getRealValue(int idx = -1)
- [DllImport(LIBNAME)]
- private static extern double dnn_DictValue_getRealValue_10(IntPtr nativeObj, int idx);
- [DllImport(LIBNAME)]
- private static extern double dnn_DictValue_getRealValue_11(IntPtr nativeObj);
- // C++: int cv::dnn::DictValue::getIntValue(int idx = -1)
- [DllImport(LIBNAME)]
- private static extern int dnn_DictValue_getIntValue_10(IntPtr nativeObj, int idx);
- [DllImport(LIBNAME)]
- private static extern int dnn_DictValue_getIntValue_11(IntPtr nativeObj);
- // native support for java finalize()
- [DllImport(LIBNAME)]
- private static extern void dnn_DictValue_delete(IntPtr nativeObj);
- #endif
- }
- }
- #endif
|