Exemple #1
0
        public static void DrawRectangle(Array2DBase image, Rectangle rect, RgbAlphaPixel color, uint thickness = 1)
        {
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }

            image.ThrowIfDisposed();

            using (var native = rect.ToNative())
            {
                var ret = Native.draw_rectangle(
                    Native.Array2DType.RgbAlphaPixel,
                    image.NativePtr,
                    native.NativePtr,
                    ref color,
                    thickness);
                switch (ret)
                {
                case Native.ErrorType.ArrayTypeNotSupport:
                    throw new ArgumentException($"{color} is not supported.");
                }
            }
        }
Exemple #2
0
 public MModRect(Rectangle rectangle)
 {
     using (var native = rectangle.ToNative())
         this.NativePtr = NativeMethods.mmod_rect_new2(native.NativePtr);
 }
Exemple #3
0
 public ChipDetails(Rectangle rect)
 {
     using (var tmp = rect.ToNative())
         this.NativePtr = NativeMethods.chip_details_new6(tmp.NativePtr);
 }
Exemple #4
0
 public FullObjectDetection(Rectangle rectangle)
 {
     using (var native = rectangle.ToNative())
         this.NativePtr = NativeMethods.full_object_detection_new2(native.NativePtr);
     this._Parts = NativeMethods.full_object_detection_num_parts(this.NativePtr);
 }