/// <summary> A MagickWand extension method that overlay image. </summary>
 /// <param name="wand"> The wand to act on. </param>
 /// <param name="compose"> The compose. </param>
 /// <param name="x"> The x coordinate. </param>
 /// <param name="y"> The y coordinate. </param>
 /// <param name="width"> The width. </param>
 /// <param name="height"> The height. </param>
 /// <param name="magickwand"> The magickwand. </param>
 internal static void OverlayImage(this ImageWand wand, CompositeOperator compose, double x, double y, double width, double height, MagickWand magickwand)
 {
     using (var draw = new DrawingWand())
     {
         draw.DrawComposite(compose, x, y, width, height, magickwand.CurrentImage);
         wand.DrawImage(draw);
     }
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DrawableComposite"/> class.
 /// </summary>
 /// <param name="x">The X coordinate.</param>
 /// <param name="y">The Y coordinate.</param>
 /// <param name="compose">The algorithm to use.</param>
 /// <param name="image">The image to draw.</param>
 public DrawableComposite(double x, double y, CompositeOperator compose, MagickImage image)
   : this(image)
 {
   X = x;
   Y = y;
   Width = _Image.Width;
   Height = _Image.Height;
   Compose = compose;
 }
 ///<summary>
 /// Creates a new DrawableCompositeImage instance.
 ///</summary>
 ///<param name="x">The X coordinate.</param>
 ///<param name="y">The Y coordinate.</param>
 ///<param name="compose">The algorithm to use.</param>
 ///<param name="image">The image to draw.</param>
 public DrawableCompositeImage(double x, double y, CompositeOperator compose, MagickImage image)
     : this(image)
 {
     X       = x;
     Y       = y;
     Width   = image.Width;
     Height  = image.Height;
     Compose = compose;
 }
Example #4
0
 public CompositeFilterEffect(string filterInput1, string filterInput2, CompositeOperator @operator, string resultName) : base(filterInput1, resultName)
 {
     SetAttr(new
     {
         in1 = filterInput1,
         in2 = filterInput2,
     });
     SetAttr("operator", @operator.ToString().Camelize());
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DrawableComposite"/> class.
 /// </summary>
 /// <param name="x">The X coordinate.</param>
 /// <param name="y">The Y coordinate.</param>
 /// <param name="compose">The algorithm to use.</param>
 /// <param name="image">The image to draw.</param>
 public DrawableComposite(double x, double y, CompositeOperator compose, IMagickImage <QuantumType> image)
     : this(image)
 {
     X       = x;
     Y       = y;
     Width   = _image.Width;
     Height  = _image.Height;
     Compose = compose;
 }
Example #6
0
 public CompositeFilter(IFilterComponent secondInput, CompositeOperator operation, decimal k1, decimal k2, decimal k3, decimal k4)
 {
     SecondInput = secondInput;
     Operation   = operation;
     K1          = k1;
     K2          = k2;
     K3          = k3;
     K4          = k4;
 }
        ///<summary>
        /// Creates a new DrawableCompositeImage instance.
        ///</summary>
        ///<param name="offset">The offset from origin.</param>
        ///<param name="compose">The algorithm to use.</param>
        ///<param name="image">The image to draw.</param>
        public DrawableCompositeImage(MagickGeometry offset, CompositeOperator compose, MagickImage image)
            : this(image)
        {
            Throw.IfNull("offset", offset);

            X       = offset.X;
            Y       = offset.Y;
            Width   = offset.Width;
            Height  = offset.Height;
            Compose = compose;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DrawableComposite"/> class.
        /// </summary>
        /// <param name="offset">The offset from origin.</param>
        /// <param name="compose">The algorithm to use.</param>
        /// <param name="image">The image to draw.</param>
        public DrawableComposite(IMagickGeometry offset, CompositeOperator compose, IMagickImage <QuantumType> image)
            : this(image)
        {
            Throw.IfNull(nameof(offset), offset);

            X       = offset.X;
            Y       = offset.Y;
            Width   = offset.Width;
            Height  = offset.Height;
            Compose = compose;
        }
        /// <summary>
        /// Initializes a new instance of <see cref="CompositeExpression"/>, with the specified left, right and operator arguments.
        /// </summary>
        /// <param name="left">The left hand expression to compare.</param>
        /// <param name="right">The right hand expression to compare.</param>
        /// <param name="type">The operator to use when comparing the left and right hand predicates.</param>
        public CompositeExpression(AExpression left, AExpression right, CompositeOperator type = CompositeOperator.And)
        {
            if (left == null)
            {
                throw new ArgumentNullException(nameof(left));
            }
            if (right == null)
            {
                throw new ArgumentNullException(nameof(right));
            }

            Left     = left;
            Right    = right;
            Operator = type;
        }
 /// <summary> Magick composite image. </summary>
 /// <param name="wand"> Handle of the wand. </param>
 /// <param name="sourcePtr"> Source pointer. </param>
 /// <param name="compositeOperator"> The composite operator. </param>
 /// <param name="x"> The x coordinate. </param>
 /// <param name="y"> The y coordinate. </param>
 /// <returns> An int. </returns>
 internal static bool MagickCompositeImage(IntPtr wand, IntPtr sourcePtr, CompositeOperator compositeOperator,
     int x, int y)
 {
     return MagickCompositeImageInternal(wand, sourcePtr, compositeOperator, (IntPtr)x, (IntPtr)y);
 }
Example #11
0
 public static extern MagickBooleanType MagickCompositeImageGravity(IntPtr magickWand1, IntPtr magickWand2, CompositeOperator op3, [In] GravityType gravityType4);
Example #12
0
 public BlendMode(string name, CompositeOperator blendType)
 {
     this.name      = name;
     this.blendType = blendType;
 }
Example #13
0
 public BlendMode(string name)
 {
     this.name      = name;
     this.blendType = CompositeOperator.No;
 }
Example #14
0
 public static extern MagickBooleanType DrawComposite(IntPtr drawingWand1, CompositeOperator op2, [In] double val3, [In] double val4, [In] double val5, [In] double val6, IntPtr magickWand7);
Example #15
0
 public void Composite(double x, double y, double width, double height, CompositeOperator compositeOperator, IMagickImage image) => _nativeInstance.Composite(x, y, width, height, compositeOperator, image);
Example #16
0
 public void CompositeImage(MagickImage sourceImage, CompositeOperator compose, int x, int y)
 {
     this.ExecuteChecked(ImageMagick.MagickCompositeImage, sourceImage.Handle, (int)compose, x, y);
 }
Example #17
0
        /// <summary> Gets or sets a value indicating whether the stroke antialias. </summary>
        /// <value> true if stroke antialias, false if not. </value>

        /*private bool StrokeAntialias
         * {
         *      get { return DrawingWandInterop.DrawGetStrokeAntialias(this); }
         *      set { DrawingWandInterop.DrawSetStrokeAntialias(this, value); }
         * }
         *
         * /// <summary> Gets or sets the fill opacity. </summary>
         * /// <value> The fill opacity. </value>
         * private double FillOpacity
         * {
         *      get { return DrawingWandInterop.DrawGetFillOpacity(this); }
         *      set { DrawingWandInterop.DrawSetFillOpacity(this, value); }
         * }
         *
         * /// <summary> Gets or sets the opacity. </summary>
         * /// <value> The opacity. </value>
         * private double Opacity
         * {
         *      get { return DrawingWandInterop.DrawGetOpacity(this); }
         *      set { DrawingWandInterop.DrawSetOpacity(this, value); }
         * }
         *
         * /// <summary> Gets or sets the vector graphics. </summary>
         * /// <value> The vector graphics. </value>
         * private string VectorGraphics
         * {
         *      get { return DrawingWandInterop.DrawGetVectorGraphics(this); }
         *      set { DrawingWandInterop.DrawSetVectorGraphics(this, value); }
         * }*/

        /// <summary> Draw composite. </summary>
        /// <param name="compose"> The compose. </param>
        /// <param name="x"> The x coordinate. </param>
        /// <param name="y"> The y coordinate. </param>
        /// <param name="width"> The width. </param>
        /// <param name="height"> The height. </param>
        /// <param name="imageWand"> The magickwand. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        internal bool DrawComposite(CompositeOperator compose, double x, double y, double width, double height, ImageWand imageWand)
        {
            return(this.CheckErrorBool(DrawingWandInterop.DrawComposite(this, compose, x, y, width, height, imageWand.MagickWand.Handle)));
        }
		public DrawableCompositeImage(MagickGeometry offset, CompositeOperator compose, MagickImage image)
			: base(AssemblyHelper.CreateInstance(Types.DrawableCompositeImage, new Type[] {Types.MagickGeometry, Types.CompositeOperator, Types.MagickImage}, GraphicsMagick.MagickGeometry.GetInstance(offset), compose, GraphicsMagick.MagickImage.GetInstance(image)))
		{
		}
Example #19
0
 public void Composite(double x, double y, double width, double height, CompositeOperator compositeOperator, MagickImage image)
 {
   IntPtr exception = IntPtr.Zero;
   #if ANYCPU
   if (NativeLibrary.Is64Bit)
   #endif
   #if WIN64 || ANYCPU
   NativeMethods.X64.DrawingWand_Composite(Instance, x, y, width, height, (UIntPtr)compositeOperator, MagickImage.GetInstance(image), out exception);
   #endif
   #if ANYCPU
   else
   #endif
   #if !WIN64 || ANYCPU
   NativeMethods.X86.DrawingWand_Composite(Instance, x, y, width, height, (UIntPtr)compositeOperator, MagickImage.GetInstance(image), out exception);
   #endif
   CheckException(exception);
 }
Example #20
0
 internal static extern bool DrawComposite(IntPtr wand, CompositeOperator compose, double x, double y, double width, double height, IntPtr magickwand);
Example #21
0
 public void Composite(double x, double y, double width, double height, CompositeOperator compositeOperator, MagickImage image)
 {
   _NativeInstance.Composite(x, y, width, height, compositeOperator, image);
 }
Example #22
0
 /// <summary>
 /// Creates a new DrawableCompositeImage instance.
 /// </summary>
 /// <param name="x">The X coordinate.</param>
 /// <param name="y">The Y coordinate.</param>
 /// <param name="compose">The algorithm to use.</param>
 /// <param name="image">The image to draw.</param>
 public Drawables Composite(double x, double y, CompositeOperator compose, MagickImage image)
 {
   _Drawables.Add(new DrawableComposite(x, y, compose, image));
   return this;
 }
Example #23
0
 /// <summary>
 /// Creates a new DrawableCompositeImage instance.
 /// </summary>
 /// <param name="offset">The offset from origin.</param>
 /// <param name="compose">The algorithm to use.</param>
 /// <param name="image">The image to draw.</param>
 public Drawables Composite(MagickGeometry offset, CompositeOperator compose, MagickImage image)
 {
   _Drawables.Add(new DrawableComposite(offset, compose, image));
   return this;
 }
Example #24
0
 public void DrawComposite(CompositeOperator compose, double x, double y, double width, double height, MagickWand magickWand)
 {
     Check(MagickWandApi.DrawComposite(Wand, compose, x, y, width, height, magickWand.Wand));
 }
 internal static extern bool DrawComposite(IntPtr wand, CompositeOperator compose, double x, double y, double width, double height, IntPtr magickwand);
Example #26
0
 /// <summary> Magick composite image. </summary>
 /// <param name="wand"> Handle of the wand. </param>
 /// <param name="sourcePtr"> Source pointer. </param>
 /// <param name="compositeOperator"> The composite operator. </param>
 /// <param name="x"> The x coordinate. </param>
 /// <param name="y"> The y coordinate. </param>
 /// <returns> An int. </returns>
 internal static bool MagickCompositeImage(IntPtr wand, IntPtr sourcePtr, CompositeOperator compositeOperator,
                                           int x, int y)
 {
     return(MagickCompositeImageInternal(wand, sourcePtr, compositeOperator, (IntPtr)x, (IntPtr)y));
 }
Example #27
0
 private static extern bool MagickSetImageCompose(IntPtr wand, CompositeOperator compose);
		public DrawableCompositeImage(Double x, Double y, CompositeOperator compose, MagickImage image)
			: base(AssemblyHelper.CreateInstance(Types.DrawableCompositeImage, new Type[] {typeof(Double), typeof(Double), Types.CompositeOperator, Types.MagickImage}, x, y, compose, GraphicsMagick.MagickImage.GetInstance(image)))
		{
		}
Example #29
0
 /// <summary>
 /// Applies the DrawableComposite operation to the <see cref="Drawables" />.
 /// </summary>
 /// <param name="x">The X coordinate.</param>
 /// <param name="y">The Y coordinate.</param>
 /// <param name="compose">The algorithm to use.</param>
 /// <param name="image">The image to draw.</param>
 /// <returns>The <see cref="Drawables" /> instance.</returns>
 public IDrawables <QuantumType> Composite(double x, double y, CompositeOperator compose, IMagickImage <QuantumType> image)
 {
     _drawables.Add(new DrawableComposite(x, y, compose, image));
     return(this);
 }
Example #30
0
        /// <summary> Color matrix image. </summary>
        /// <param name="matrix"> The matrix. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>

        /*private bool ColorMatrixImage(double[,] matrix)
         * {
         *      return this.ActivateImageWand(() => this.MagickWand.CheckErrorBool(ImageWandInterop.MagickColorMatrixImage(this.MagickWand, matrix)));
         * }*/

        /// <summary> Composite image. </summary>
        /// <param name="sourcePtr"> Source pointer. </param>
        /// <param name="compositeOperator"> The composite operator. </param>
        /// <param name="x"> The x coordinate. </param>
        /// <param name="y"> The y coordinate. </param>
        /// <returns> true if it succeeds, false if it fails. </returns>
        public bool CompositeImage(MagickWand sourcePtr, CompositeOperator compositeOperator, int x, int y)
        {
            return(this.ActivateImageWand(() => this.MagickWand.CheckErrorBool(ImageWandInterop.MagickCompositeImage(this.MagickWand, sourcePtr, compositeOperator, x, y))));
        }
 /// <summary> A MagickWand extension method that overlay image. </summary>
 /// <param name="wand"> The wand to act on. </param>
 /// <param name="compose"> The compose. </param>
 /// <param name="x"> The x coordinate. </param>
 /// <param name="y"> The y coordinate. </param>
 /// <param name="width"> The width. </param>
 /// <param name="height"> The height. </param>
 /// <param name="magickwand"> The magickwand. </param>
 internal static void OverlayImage(this ImageWand wand, CompositeOperator compose, double x, double y, double width, double height, MagickWand magickwand)
 {
     using (var draw = new DrawingWand())
     {
         draw.DrawComposite(compose, x, y, width, height, magickwand.CurrentImage);
         wand.DrawImage(draw);
     }
 }
Example #32
0
 private static extern bool MagickCompositeImageInternal(IntPtr wand, IntPtr sourcePtr, CompositeOperator compositeOperator, IntPtr x, IntPtr y);
Example #33
0
 /// <summary>
 /// Adds a new instance of the <see cref="DrawableComposite" /> class to the <see cref="Drawables" />.
 /// </summary>
 /// <param name="x">The X coordinate.</param>
 /// <param name="y">The Y coordinate.</param>
 /// <param name="compose">The algorithm to use.</param>
 /// <param name="image">The image to draw.</param>
 /// <returns>The <see cref="Drawables" /> instance.</returns>
 public Drawables Composite(double x, double y, CompositeOperator compose, MagickImage image)
 {
     _Drawables.Add(new DrawableComposite(x, y, compose, image));
     return(this);
 }
Example #34
0
 /// <summary>
 /// Applies the DrawableComposite operation to the <see cref="Drawables" />.
 /// </summary>
 /// <param name="offset">The offset from origin.</param>
 /// <param name="compose">The algorithm to use.</param>
 /// <param name="image">The image to draw.</param>
 /// <returns>The <see cref="Drawables" /> instance.</returns>
 public IDrawables <QuantumType> Composite(IMagickGeometry offset, CompositeOperator compose, IMagickImage <QuantumType> image)
 {
     _drawables.Add(new DrawableComposite(offset, compose, image));
     return(this);
 }
Example #35
0
 public void Composite(Image sourceImage, CompositeOperator compose, int x, int y)
 {
     this.image.CompositeImage(sourceImage.image, compose, x, y);
 }
Example #36
0
    /// <summary>
    /// Initializes a new instance of the <see cref="DrawableComposite"/> class.
    /// </summary>
    /// <param name="offset">The offset from origin.</param>
    /// <param name="compose">The algorithm to use.</param>
    /// <param name="image">The image to draw.</param>
    public DrawableComposite(MagickGeometry offset, CompositeOperator compose, MagickImage image)
      : this(image)
    {
      Throw.IfNull("offset", offset);

      X = offset.X;
      Y = offset.Y;
      Width = offset.Width;
      Height = offset.Height;
      Compose = compose;
    }
Example #37
0
 public void CompositeGravity(MagickImage image, Gravity gravity, CompositeOperator compose)
 {
   IntPtr exception = IntPtr.Zero;
   #if ANYCPU
   if (NativeLibrary.Is64Bit)
   #endif
   #if WIN64 || ANYCPU
   NativeMethods.X64.MagickImage_CompositeGravity(Instance, MagickImage.GetInstance(image), (UIntPtr)gravity, (UIntPtr)compose, out exception);
   #endif
   #if ANYCPU
   else
   #endif
   #if !WIN64 || ANYCPU
   NativeMethods.X86.MagickImage_CompositeGravity(Instance, MagickImage.GetInstance(image), (UIntPtr)gravity, (UIntPtr)compose, out exception);
   #endif
   CheckException(exception);
 }
Example #38
0
 /// <summary>
 /// Adds a new instance of the <see cref="DrawableComposite" /> class to the <see cref="Drawables" />.
 /// </summary>
 /// <param name="offset">The offset from origin.</param>
 /// <param name="compose">The algorithm to use.</param>
 /// <param name="image">The image to draw.</param>
 /// <returns>The <see cref="Drawables" /> instance.</returns>
 public Drawables Composite(MagickGeometry offset, CompositeOperator compose, MagickImage image)
 {
     _Drawables.Add(new DrawableComposite(offset, compose, image));
     return(this);
 }
Example #39
0
 public DrawableCompositeImage(MagickGeometry offset, CompositeOperator compose, MagickImage image)
     : base(AssemblyHelper.CreateInstance(Types.DrawableCompositeImage, new Type[] { Types.MagickGeometry, Types.CompositeOperator, Types.MagickImage }, GraphicsMagick.MagickGeometry.GetInstance(offset), compose, GraphicsMagick.MagickImage.GetInstance(image)))
 {
 }
Example #40
0
 public CompositeFilterEffect Composite(string filterInput1, string filterInput2, CompositeOperator @operator, string resultName = null)
 {
     return(AddChild(new CompositeFilterEffect(filterInput1, filterInput2, @operator, resultName)));
 }
Example #41
0
 public DrawableCompositeImage(Double x, Double y, CompositeOperator compose, MagickImage image)
     : base(AssemblyHelper.CreateInstance(Types.DrawableCompositeImage, new Type[] { typeof(Double), typeof(Double), Types.CompositeOperator, Types.MagickImage }, x, y, compose, GraphicsMagick.MagickImage.GetInstance(image)))
 {
 }
Example #42
0
 public static extern MagickBooleanType MagickSetImageCompose(IntPtr magickWand1, CompositeOperator op2);
 private static extern bool MagickCompositeImageInternal(IntPtr wand, IntPtr sourcePtr, CompositeOperator compositeOperator, IntPtr x, IntPtr y);
Example #44
0
 public static extern MagickBooleanType MagickCompositeImageChannel(IntPtr magickWand1, [In] ChannelType channelType2, IntPtr magickWand3, CompositeOperator op4, IntPtr ssizetVal5, IntPtr ssizetVal6);
 private static extern bool MagickSetImageCompose(IntPtr wand, CompositeOperator compose);
Example #46
0
 public static extern MagickBooleanType MagickCompositeLayers(IntPtr magickWand1, IntPtr magickWand2, CompositeOperator op3, IntPtr ssizetVal4, IntPtr ssizetVal5);
Example #47
0
 private int GetIndex(CompositeOperator composite)
 {
     return(blendTypes.ToList().FindIndex(itm => itm.blendType == composite));
 }