Browse Source

Removed unnecessary field from bokeh blur parameters

af/octree-no-pixelmap
Sergio Pedri 6 years ago
parent
commit
1ff823093f
  1. 7
      src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs
  2. 11
      src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelData.cs
  3. 2
      src/ImageSharp/Processing/Processors/Convolution/Parameters/BokehBlurKernelDataProvider.cs

7
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
/// </summary>
private readonly Complex64[][] kernels;
/// <summary>
/// The scaling factor for kernel values
/// </summary>
private readonly float kernelsScale;
/// <summary>
/// Initializes a new instance of the <see cref="BokehBlurProcessor{TPixel}"/> class.
/// </summary>
@ -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;
}

11
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
/// </summary>
public readonly Vector4[] Parameters;
/// <summary>
/// The scaling factor for the kernel values
/// </summary>
public readonly float Scale;
/// <summary>
/// The kernel components to apply the bokeh blur effect
/// </summary>
@ -29,12 +24,10 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution.Parameters
/// Initializes a new instance of the <see cref="BokehBlurKernelData"/> struct.
/// </summary>
/// <param name="parameters">The kernel parameters</param>
/// <param name="scale">The kernel scale factor</param>
/// <param name="kernels">The complex kernel components</param>
public BokehBlurKernelData(Vector4[] parameters, float scale, Complex64[][] kernels)
public BokehBlurKernelData(Vector4[] parameters, Complex64[][] kernels)
{
this.Parameters = parameters;
this.Scale = scale;
this.Kernels = kernels;
}
}

2
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);
}

Loading…
Cancel
Save