Пример #1
0
 internal FloatImp(DlibObject parent,
                   KernelBaseParameter kernelParameter,
                   NativeMethods.MatrixElementType elementType,
                   NativeMethods.SvmFunctionType functionType) :
     base(parent, kernelParameter, elementType, functionType)
 {
 }
Пример #2
0
 internal Imp(DlibObject parent,
              KernelBaseParameter kernelParameter,
              NativeMethods.MatrixElementType elementType,
              NativeMethods.SvmFunctionType functionType)
 {
     this.Parent          = parent ?? throw new ArgumentNullException(nameof(parent));
     this.KernelParameter = kernelParameter;
     this.ElementType     = elementType;
     this.FunctionType    = functionType;
 }
Пример #3
0
 internal VectorDoubleImp(DlibObject parent, Dlib.Native.VectorElementType type)
     : base(parent, type)
 {
 }
Пример #4
0
 internal VectorImp(DlibObject parent, Dlib.Native.VectorElementType type)
 {
     this._Parent = parent ?? throw new ArgumentNullException(nameof(parent));
     this._Type   = type;
 }
Пример #5
0
 protected bool Equals(DlibObject other)
 {
     return(this.NativePtr.Equals(other.NativePtr));
 }
Пример #6
0
 internal VectorDoubleImp(DlibObject parent, NativeMethods.VectorElementType type)
     : base(parent, type)
 {
 }
Пример #7
0
 internal RunningStatsDoubleImp(DlibObject parent, Dlib.Native.RunningStatsType type)
     : base(parent, type)
 {
 }
Пример #8
0
 protected RunningStatsImp(DlibObject parent, Dlib.Native.RunningStatsType type)
 {
     this._Parent = parent;
     this._Type   = type;
 }
Пример #9
0
        /// <summary>
        /// Releases all unmanaged resources.
        /// </summary>
        protected override void DisposeUnmanaged()
        {
            base.DisposeUnmanaged();

            if (this.NativePtr == IntPtr.Zero)
            {
                return;
            }

            switch (this._ElementType)
            {
            case NativeMethods.ElementType.OpHeatmap:
                NativeMethods.matrix_op_op_heatmap_delete(this._Array2DType, this.NativePtr);
                break;

            case NativeMethods.ElementType.OpJet:
                NativeMethods.matrix_op_op_jet_delete(this._Array2DType, this.NativePtr);
                break;

            case NativeMethods.ElementType.OpArray2DToMat:
                NativeMethods.matrix_op_op_array2d_to_mat_delete(this._Array2DType, this.NativePtr);
                break;

            case NativeMethods.ElementType.OpTrans:
                NativeMethods.matrix_op_op_trans_delete(this._MatrixElementType, this.NativePtr, this.TemplateRows, this.TemplateColumns);
                break;

            case NativeMethods.ElementType.OpStdVectToMat:
                NativeMethods.matrix_op_op_std_vect_to_mat_delete(this._MatrixElementType, this.NativePtr, this.TemplateRows, this.TemplateColumns);
                break;

            case NativeMethods.ElementType.OpStdVectToMatValue:
                DlibObject vector = null;
                switch (this._Array2DType)
                {
                case NativeMethods.Array2DType.UInt8:
                    vector = new StdVector <byte>(this._Ref);
                    break;

                case NativeMethods.Array2DType.UInt16:
                    vector = new StdVector <ushort>(this._Ref);
                    break;

                case NativeMethods.Array2DType.UInt32:
                    vector = new StdVector <uint>(this._Ref);
                    break;

                case NativeMethods.Array2DType.Int8:
                    vector = new StdVector <sbyte>(this._Ref);
                    break;

                case NativeMethods.Array2DType.Int16:
                    vector = new StdVector <short>(this._Ref);
                    break;

                case NativeMethods.Array2DType.Int32:
                    vector = new StdVector <int>(this._Ref);
                    break;

                case NativeMethods.Array2DType.Float:
                    vector = new StdVector <float>(this._Ref);
                    break;

                case NativeMethods.Array2DType.Double:
                    vector = new StdVector <double>(this._Ref);
                    break;

                case NativeMethods.Array2DType.RgbPixel:
                    vector = new StdVector <RgbPixel>(this._Ref);
                    break;

                case NativeMethods.Array2DType.RgbAlphaPixel:
                    vector = new StdVector <RgbAlphaPixel>(this._Ref);
                    break;

                case NativeMethods.Array2DType.HsiPixel:
                    vector = new StdVector <HsiPixel>(this._Ref);
                    break;
                }
                vector?.Dispose();
                NativeMethods.matrix_op_op_std_vect_to_mat_value_delete(this._Array2DType, this.NativePtr);
                break;

            case NativeMethods.ElementType.OpJoinRows:
                NativeMethods.matrix_op_op_join_rows_delete(this._MatrixElementType, this.NativePtr, this.TemplateRows, this.TemplateColumns);
                break;
            }
        }
Пример #10
0
 internal MatrixRgbAlphaPixelImp(DlibObject parent, NativeMethods.MatrixElementType type)
     : base(parent, type)
 {
 }
Пример #11
0
 internal MatrixFloatImp(DlibObject parent, NativeMethods.MatrixElementType type)
     : base(parent, type)
 {
 }
Пример #12
0
 internal Imp(DlibObject parent, NativeMethods.MatrixElementType type)
 {
     this.Parent = parent ?? throw new ArgumentNullException(nameof(parent));
     this.Type   = type;
 }
Пример #13
0
 internal VectorFloatImp(DlibObject parent, VectorElementType type)
     : base(parent, type)
 {
 }
Пример #14
0
 internal VectorUInt32Imp(DlibObject parent, VectorElementType type)
     : base(parent, type)
 {
 }
Пример #15
0
 internal RunningStatsDoubleImp(DlibObject parent, NativeMethods.RunningStatsType type)
     : base(parent, type)
 {
 }