|
|
|
@ -36,11 +36,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution |
|
|
|
/// </summary>
|
|
|
|
private readonly float gamma; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The execution mode to use when applying the effect
|
|
|
|
/// </summary>
|
|
|
|
private readonly BokehBlurExecutionMode executionMode; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The maximum size of the kernel in either direction
|
|
|
|
/// </summary>
|
|
|
|
@ -84,7 +79,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution |
|
|
|
this.kernelSize = (this.radius * 2) + 1; |
|
|
|
this.componentsCount = definition.Components; |
|
|
|
this.gamma = definition.Gamma; |
|
|
|
this.executionMode = definition.ExecutionMode; |
|
|
|
|
|
|
|
// Reuse the initialized values from the cache, if possible
|
|
|
|
var parameters = new BokehBlurParameters(this.radius, this.componentsCount); |
|
|
|
@ -396,12 +390,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution |
|
|
|
var workingRectangle = Rectangle.FromLTRB(startX, startY, endX, endY); |
|
|
|
int width = workingRectangle.Width; |
|
|
|
|
|
|
|
if (this.executionMode == BokehBlurExecutionMode.PreferLowMemoryUsage) |
|
|
|
{ |
|
|
|
configuration = configuration.Clone(); |
|
|
|
configuration.MaxDegreeOfParallelism = 1; |
|
|
|
} |
|
|
|
|
|
|
|
ParallelHelper.IterateRows( |
|
|
|
workingRectangle, |
|
|
|
configuration, |
|
|
|
|