@@ -21,26 +21,11 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
2121 internal class BokehBlurProcessor < TPixel > : ImageProcessor < TPixel >
2222 where TPixel : struct , IPixel < TPixel >
2323 {
24- /// <summary>
25- /// The kernel radius.
26- /// </summary>
27- private readonly int radius ;
28-
2924 /// <summary>
3025 /// The gamma highlight factor to use when applying the effect
3126 /// </summary>
3227 private readonly float gamma ;
3328
34- /// <summary>
35- /// The maximum size of the kernel in either direction
36- /// </summary>
37- private readonly int kernelSize ;
38-
39- /// <summary>
40- /// The number of components to use when applying the bokeh blur
41- /// </summary>
42- private readonly int componentsCount ;
43-
4429 /// <summary>
4530 /// The kernel parameters to use for the current instance (a: X, b: Y, A: Z, B: W)
4631 /// </summary>
@@ -61,13 +46,13 @@ internal class BokehBlurProcessor<TPixel> : ImageProcessor<TPixel>
6146 public BokehBlurProcessor ( Configuration configuration , BokehBlurProcessor definition , Image < TPixel > source , Rectangle sourceRectangle )
6247 : base ( configuration , source , sourceRectangle )
6348 {
64- this . radius = definition . Radius ;
65- this . kernelSize = ( this . radius * 2 ) + 1 ;
66- this . componentsCount = definition . Components ;
6749 this . gamma = definition . Gamma ;
6850
6951 // Get the bokeh blur data
70- BokehBlurKernelData data = BokehBlurKernelDataProvider . GetBokehBlurKernelData ( this . radius , this . kernelSize , this . componentsCount ) ;
52+ BokehBlurKernelData data = BokehBlurKernelDataProvider . GetBokehBlurKernelData (
53+ definition . Radius ,
54+ ( definition . Radius * 2 ) + 1 ,
55+ definition . Components ) ;
7156
7257 this . kernelParameters = data . Parameters ;
7358 this . kernels = data . Kernels ;
0 commit comments