From 2f68f0ded016891fbd59c51268b73ab9672ccbe8 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 27 Nov 2019 13:07:53 +0100 Subject: [PATCH] Removed execution mode options --- .../Extensions/BokehBlurExtensions.cs | 48 ------------------- .../Convolution/BokehBlurProcessor.cs | 44 +---------------- 2 files changed, 1 insertion(+), 91 deletions(-) diff --git a/src/ImageSharp/Processing/Extensions/BokehBlurExtensions.cs b/src/ImageSharp/Processing/Extensions/BokehBlurExtensions.cs index ef20f940a..2bbdd03b0 100644 --- a/src/ImageSharp/Processing/Extensions/BokehBlurExtensions.cs +++ b/src/ImageSharp/Processing/Extensions/BokehBlurExtensions.cs @@ -19,15 +19,6 @@ namespace SixLabors.ImageSharp.Processing public static IImageProcessingContext BokehBlur(this IImageProcessingContext source) => source.ApplyProcessor(new BokehBlurProcessor()); - /// - /// Applies a bokeh blur to the image. - /// - /// The image this method extends. - /// The execution mode to use when applying the processor. - /// The to allow chaining of operations. - public static IImageProcessingContext BokehBlur(this IImageProcessingContext source, BokehBlurExecutionMode executionMode) - => source.ApplyProcessor(new BokehBlurProcessor(executionMode)); - /// /// Applies a bokeh blur to the image. /// @@ -39,18 +30,6 @@ namespace SixLabors.ImageSharp.Processing public static IImageProcessingContext BokehBlur(this IImageProcessingContext source, int radius, int components, float gamma) => source.ApplyProcessor(new BokehBlurProcessor(radius, components, gamma)); - /// - /// Applies a bokeh blur to the image. - /// - /// The image this method extends. - /// The 'radius' value representing the size of the area to sample. - /// The 'components' value representing the number of kernels to use to approximate the bokeh effect. - /// The gamma highlight factor to use to emphasize bright spots in the source image - /// The execution mode to use when applying the processor. - /// The to allow chaining of operations. - public static IImageProcessingContext BokehBlur(this IImageProcessingContext source, int radius, int components, float gamma, BokehBlurExecutionMode executionMode) - => source.ApplyProcessor(new BokehBlurProcessor(radius, components, gamma, executionMode)); - /// /// Applies a bokeh blur to the image. /// @@ -62,18 +41,6 @@ namespace SixLabors.ImageSharp.Processing public static IImageProcessingContext BokehBlur(this IImageProcessingContext source, Rectangle rectangle) => source.ApplyProcessor(new BokehBlurProcessor(), rectangle); - /// - /// Applies a bokeh blur to the image. - /// - /// The image this method extends. - /// - /// The structure that specifies the portion of the image object to alter. - /// - /// The execution mode to use when applying the processor. - /// The to allow chaining of operations. - public static IImageProcessingContext BokehBlur(this IImageProcessingContext source, Rectangle rectangle, BokehBlurExecutionMode executionMode) - => source.ApplyProcessor(new BokehBlurProcessor(executionMode), rectangle); - /// /// Applies a bokeh blur to the image. /// @@ -87,20 +54,5 @@ namespace SixLabors.ImageSharp.Processing /// The to allow chaining of operations. public static IImageProcessingContext BokehBlur(this IImageProcessingContext source, int radius, int components, float gamma, Rectangle rectangle) => source.ApplyProcessor(new BokehBlurProcessor(radius, components, gamma), rectangle); - - /// - /// Applies a bokeh blur to the image. - /// - /// The image this method extends. - /// The 'radius' value representing the size of the area to sample. - /// The 'components' value representing the number of kernels to use to approximate the bokeh effect. - /// The gamma highlight factor to use to emphasize bright spots in the source image - /// The execution mode to use when applying the processor. - /// - /// The structure that specifies the portion of the image object to alter. - /// - /// The to allow chaining of operations. - public static IImageProcessingContext BokehBlur(this IImageProcessingContext source, int radius, int components, float gamma, BokehBlurExecutionMode executionMode, Rectangle rectangle) - => source.ApplyProcessor(new BokehBlurProcessor(radius, components, gamma, executionMode), rectangle); } } diff --git a/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor.cs index b7e102deb..1812884b8 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor.cs @@ -26,27 +26,11 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution /// public const float DefaultGamma = 3F; - /// - /// The default execution mode used by the parameterless constructor. - /// - public const BokehBlurExecutionMode DefaultExecutionMode = BokehBlurExecutionMode.PreferLowMemoryUsage; - /// /// Initializes a new instance of the class. /// public BokehBlurProcessor() - : this(DefaultRadius, DefaultComponents, DefaultGamma, DefaultExecutionMode) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The execution mode to use when applying the processor. - /// - public BokehBlurProcessor(BokehBlurExecutionMode executionMode) - : this(DefaultRadius, DefaultComponents, DefaultGamma, executionMode) + : this(DefaultRadius, DefaultComponents, DefaultGamma) { } @@ -63,33 +47,12 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution /// The gamma highlight factor to use to further process the image. /// public BokehBlurProcessor(int radius, int components, float gamma) - : this(radius, components, gamma, DefaultExecutionMode) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The 'radius' value representing the size of the area to sample. - /// - /// - /// The number of components to use to approximate the original 2D bokeh blur convolution kernel. - /// - /// - /// The gamma highlight factor to use to further process the image. - /// - /// - /// The execution mode to use when applying the processor. - /// - public BokehBlurProcessor(int radius, int components, float gamma, BokehBlurExecutionMode executionMode) { Guard.MustBeGreaterThanOrEqualTo(gamma, 1, nameof(gamma)); this.Radius = radius; this.Components = components; this.Gamma = gamma; - this.ExecutionMode = executionMode; } /// @@ -107,11 +70,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution /// public float Gamma { get; } - /// - /// Gets the execution mode to use when applying the effect. - /// - public BokehBlurExecutionMode ExecutionMode { get; } - /// public IImageProcessor CreatePixelSpecificProcessor(Image source, Rectangle sourceRectangle) where TPixel : struct, IPixel