コード例 #1
0
        /// <summary>
        /// **NOTE: Expensive Calculation on Large Images**
        /// Blurs the image using a kernel of Gaussian distribution.
        /// </summary>
        /// <param name="this">The current ImageEditorState.</param>
        /// <param name="size">The size of the kernel used to calculate the blur.</param>
        public static void GaussianBlur(this ImageEditorState @this, int size)
        {
            var newImage = ImageProcessor.Instance.GaussianBlur(@this.Image, size);

            @this.Update(newImage);
        }
コード例 #2
0
        /// <summary>
        /// Alters the hue of the image by changing the overall color.
        /// </summary>
        /// <param name="this">The current ImageEditorState.</param>
        /// <param name="degrees">The angle by which to alter the image. Any integer between 0 and 360.</param>
        /// <param name="rotate">Whether to rotate the hue of the entire image or each pixel individually.</param>
        public static void Hue(this ImageEditorState @this, int degrees, bool rotate = false)
        {
            var newImage = ImageProcessor.Instance.Hue(@this.Image, degrees, rotate);

            @this.Update(newImage);
        }
コード例 #3
0
        /// <summary>
        /// Rounds the corner of the image.
        /// </summary>
        /// <param name="this">The current ImageEditorState.</param>
        /// <param name="radius">The radius of the corner to be added.</param>
        public static void RoundedCorners(this ImageEditorState @this, int radius)
        {
            var newImage = ImageProcessor.Instance.RoundedCorners(@this.Image, radius);

            @this.Update(newImage);
        }
コード例 #4
0
        /// <summary>
        /// Changes the saturation of the image.
        /// </summary>
        /// <param name="this">The current ImageEditorState.</param>
        /// <param name="percentage">The percentage by which the saturation will be affected.
        /// Any integer value between -100 and 100.</param>
        public static void Saturation(this ImageEditorState @this, int percentage)
        {
            var newImage = ImageProcessor.Instance.Saturation(@this.Image, percentage);

            @this.Update(newImage);
        }
コード例 #5
0
        /// <summary>
        /// Changes the brightness of the image.
        /// </summary>
        /// <param name="this">The current ImageEditorState.</param>
        /// <param name="percentage">The amount of change in brightness of each pixel, as a percentage.</param>
        public static void Brightness(this ImageEditorState @this, int percentage)
        {
            var newImage = ImageProcessor.Instance.Brightness(@this.Image, percentage);

            @this.Update(newImage);
        }
コード例 #6
0
        /// <summary>
        /// Sets the output quality of the image when saved using the ImageProcessor.
        /// </summary>
        /// <param name="this">The current ImageEditorState.</param>
        /// <param name="percentage">The percentage by which to alter the image's quality. Any integer between 0 and 100.</param>
        public static void Quality(this ImageEditorState @this, int percentage)
        {
            var newImage = ImageProcessor.Instance.Quality(@this.Image, percentage);

            @this.Update(newImage);
        }
コード例 #7
0
        /// <summary>
        /// Flips the image.
        /// </summary>
        /// <param name="this">The current ImageEditorState.</param>
        /// <param name="verticalFlip">Whether the image will be flipped vertically or horizontally.</param>
        public static void Flip(this ImageEditorState @this, bool verticalFlip = false)
        {
            var newImage = ImageProcessor.Instance.Flip(@this.Image, verticalFlip);

            @this.Update(newImage);
        }
コード例 #8
0
        /// <summary>
        /// Crops an image to the area of greatest entropy.
        /// </summary>
        /// <param name="this">The current ImageEditorState.</param>
        /// <param name="threshold">The threshold in bytes to control the detection level.</param>
        public static void EntropyCrop(this ImageEditorState @this, byte threshold = 128)
        {
            var newImage = ImageProcessor.Instance.EntropyCrop(@this.Image, threshold);

            @this.Update(newImage);
        }
コード例 #9
0
        public static void Test(this ImageEditorState @this, int radius)
        {
            var newImage = ImageProcessor.Instance.Pixelate(@this.Image, radius);

            @this.Update(newImage);
        }
コード例 #10
0
        /// <summary>
        /// Changes the contrast of an image.
        /// </summary>
        /// <param name="this">The current ImageEditorState.</param>
        /// <param name="percentage">The amount of change in contrast of the image, as a percentage.</param>
        public static void Contrast(this ImageEditorState @this, int percentage)
        {
            var newImage = ImageProcessor.Instance.Contrast(@this.Image, percentage);

            @this.Update(newImage);
        }