using OpenCVForUnity.CoreModule; using OpenCVForUnity.UtilsModule; using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace OpenCVForUnity.OptflowModule { // C++: class GPCPatchDescriptor //javadoc: GPCPatchDescriptor public class GPCPatchDescriptor : 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) optflow_GPCPatchDescriptor_delete(nativeObj); nativeObj = IntPtr.Zero; } } finally { base.Dispose (disposing); } #else return; #endif } protected internal GPCPatchDescriptor (IntPtr addr) : base (addr) { } public IntPtr getNativeObjAddr () { return nativeObj; } // internal usage only public static GPCPatchDescriptor __fromPtr__ (IntPtr addr) { return new GPCPatchDescriptor (addr); } #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR const string LIBNAME = "__Internal"; #else const string LIBNAME = "opencvforunity"; #endif // native support for java finalize() [DllImport (LIBNAME)] private static extern void optflow_GPCPatchDescriptor_delete (IntPtr nativeObj); } }