A Gaussian layer for applying sharpening and blurring methods to an image.
Esempio n. 1
0
        /// <summary>
        /// Returns a value that indicates whether the specified object is an
        /// <see cref="GaussianLayer"/> object that is equivalent to
        /// this <see cref="GaussianLayer"/> object.
        /// </summary>
        /// <param name="obj">
        /// The object to test.
        /// </param>
        /// <returns>
        /// True if the given object  is an <see cref="GaussianLayer"/> object that is equivalent to
        /// this <see cref="GaussianLayer"/> object; otherwise, false.
        /// </returns>
        public override bool Equals(object obj)
        {
            GaussianLayer gaussianLayer = obj as GaussianLayer;

            if (gaussianLayer == null)
            {
                return(false);
            }

            return(this.Size == gaussianLayer.Size &&
                   Math.Abs(this.Sigma - gaussianLayer.Sigma) < 0.0001 &&
                   this.Threshold == gaussianLayer.Threshold);
        }
Esempio n. 2
0
        /// <summary>
        /// Uses a Gaussian kernel to sharpen the current image.
        /// </summary>
        /// <param name="gaussianLayer">
        /// The <see cref="T:ImageProcessor.Imaging.GaussianLayer"/> for applying sharpening and 
        /// blurring methods to an image.
        /// </param>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        public ImageFactory GaussianSharpen(GaussianLayer gaussianLayer)
        {
            if (this.ShouldProcess)
            {
                GaussianSharpen gaussianSharpen = new GaussianSharpen { DynamicParameter = gaussianLayer };
                this.CurrentImageFormat.ApplyProcessor(gaussianSharpen.ProcessImage, this);
            }

            return this;
        }
Esempio n. 3
0
        /// <summary>
        /// Uses a Gaussian kernel to sharpen the current image.
        /// <remarks>
        /// <para>
        /// The sigma and threshold values applied to the kernel are 
        /// 1.4 and 0 respectively.
        /// </para>
        /// </remarks>
        /// </summary>
        /// <param name="size">
        /// The size to set the Gaussian kernel to.
        /// </param>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        public ImageFactory GaussianSharpen(int size)
        {
            if (this.ShouldProcess && size > 0)
            {
                GaussianLayer layer = new GaussianLayer(size);
                return this.GaussianSharpen(layer);
            }

            return this;
        }
        /// <summary>
        /// Uses a Gaussian kernel to sharpen the current image.
        /// </summary>
        /// <param name="gaussianLayer">
        /// The <see cref="T:ImageProcessor.Imaging.GaussianLayer"/> for applying sharpening and 
        /// blurring methods to an image.
        /// </param>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        public ImageFactory GaussianSharpen(GaussianLayer gaussianLayer)
        {
            if (this.ShouldProcess)
            {
                GaussianSharpen gaussianSharpen = new GaussianSharpen { DynamicParameter = gaussianLayer };
                this.Image = gaussianSharpen.ProcessImage(this);
            }

            return this;
        }
        /// <summary>
        /// Uses a Gaussian kernel to sharpen the current image.
        /// <remarks>
        /// <para>
        /// The sigma and threshold values applied to the kernel are 
        /// 1.4 and 0 respectively.
        /// </para>
        /// </remarks>
        /// </summary>
        /// <param name="size">
        /// The size to set the Gaussian kernel to.
        /// </param>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        public ImageFactory GaussianSharpen(int size)
        {
            if (this.ShouldProcess && size > 0)
            {
                GaussianLayer layer = new GaussianLayer(size);
                GaussianSharpen gaussianSharpen = new GaussianSharpen { DynamicParameter = layer };
                this.Image = gaussianSharpen.ProcessImage(this);
            }

            return this;
        }
        /// <summary>
        /// Uses a Gaussian kernel to blur the current image.
        /// </summary>
        /// <param name="gaussianLayer">
        /// The <see cref="T:ImageProcessor.Imaging.GaussianLayer"/> for applying sharpening and 
        /// blurring methods to an image.
        /// </param>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        public ImageFactory GaussianBlur(GaussianLayer gaussianLayer)
        {
            if (this.ShouldProcess)
            {
                GaussianBlur gaussianBlur = new GaussianBlur { DynamicParameter = gaussianLayer };
                this.Image = gaussianBlur.ProcessImage(this);
            }

            return this;
        }
        /// <summary>
        /// Uses a Gaussian kernel to blur the current image.
        /// </summary>
        /// <param name="gaussianLayer">
        /// The <see cref="T:ImageProcessor.Imaging.GaussianLayer"/> for applying sharpening and 
        /// blurring methods to an image.
        /// </param>
        /// <returns>
        /// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
        /// </returns>
        public ImageFactory GaussianBlur(GaussianLayer gaussianLayer)
        {
            if (this.ShouldProcess)
            {
                GaussianBlur gaussianBlur = new GaussianBlur { DynamicParameter = gaussianLayer };
                this.backupFormat.ApplyProcessor(gaussianBlur.ProcessImage, this);
            }

            return this;
        }