From 1ff823093fc1941510c1d364133055c460e20bb0 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 14 Feb 2020 14:56:39 +0100 Subject: [PATCH] Removed unnecessary field from bokeh blur parameters --- .../Convolution/BokehBlurProcessor{TPixel}.cs | 7 ------- .../Convolution/Parameters/BokehBlurKernelData.cs | 11 ++--------- .../Parameters/BokehBlurKernelDataProvider.cs | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs index b80559899d..f2801718c0 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Numerics; using System.Runtime.CompilerServices; @@ -52,11 +51,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution /// private readonly Complex64[][] kernels; - /// - /// The scaling factor for kernel values - /// - private readonly float kernelsScale; - /// /// Initializes a new instance of the class. /// @@ -76,7 +70,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution BokehBlurKernelData data = BokehBlurKernelDataProvider.GetBokehBlurKernelData(this.radius, this.kernelSize, this.componentsCount); this.kernelParameters = data.Parameters; - this.kernelsScale = data.Scale; this.kernels = data.Kernels; } diff --git a/src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelData.cs b/src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelData.cs index 5f03396bad..561892683a 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelData.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelData.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System.Numerics; @@ -15,11 +15,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution.Parameters /// public readonly Vector4[] Parameters; - /// - /// The scaling factor for the kernel values - /// - public readonly float Scale; - /// /// The kernel components to apply the bokeh blur effect /// @@ -29,12 +24,10 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution.Parameters /// Initializes a new instance of the struct. /// /// The kernel parameters - /// The kernel scale factor /// The complex kernel components - public BokehBlurKernelData(Vector4[] parameters, float scale, Complex64[][] kernels) + public BokehBlurKernelData(Vector4[] parameters, Complex64[][] kernels) { this.Parameters = parameters; - this.Scale = scale; this.Kernels = kernels; } } diff --git a/src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelDataProvider.cs b/src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelDataProvider.cs index 1ff4c9ac6d..977a7993fe 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelDataProvider.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelDataProvider.cs @@ -98,7 +98,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution.Parameters NormalizeKernels(kernels, kernelParameters); // Store them in the cache for future use - info = new BokehBlurKernelData(kernelParameters, kernelsScale, kernels); + info = new BokehBlurKernelData(kernelParameters, kernels); Cache.TryAdd(parameters, info); }