diff --git a/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs index 215e0d729..d2c547bac 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs @@ -337,13 +337,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution private readonly Buffer2D sourcePixels; private readonly Complex64[] kernel; - /// - /// Initializes a new instance of the struct. - /// - /// The target processing bounds for the current instance. - /// The target values to use to store the results. - /// The source pixels. Cannot be null. - /// The 1D kernel. [MethodImpl(InliningOptions.ShortMethod)] public ApplyVerticalConvolutionRowIntervalAction( ref Rectangle bounds, @@ -388,15 +381,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution private readonly float z; private readonly float w; - /// - /// Initializes a new instance of the struct. - /// - /// The target processing bounds for the current instance. - /// The target values to use to store the results. - /// The source complex values. Cannot be null. - /// The 1D kernel. - /// The weight factor for the real component of the complex pixel values. - /// The weight factor for the imaginary component of the complex pixel values. [MethodImpl(InliningOptions.ShortMethod)] public ApplyHorizontalConvolutionRowIntervalAction( ref Rectangle bounds, @@ -443,13 +427,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution private readonly Configuration configuration; private readonly float gamma; - /// - /// Initializes a new instance of the struct. - /// - /// The target processing bounds for the current instance. - /// The target pixel buffer to adjust. - /// The - /// The gamma parameter to use. [MethodImpl(InliningOptions.ShortMethod)] public ApplyGammaExposureRowIntervalAction( Rectangle bounds, @@ -500,14 +477,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution private readonly Configuration configuration; private readonly float inverseGamma; - /// - /// Initializes a new instance of the struct. - /// - /// The target processing bounds for the current instance. - /// The target pixels to apply the process to. - /// The source values. Cannot be null. - /// The - /// The inverse gamma parameter to use. [MethodImpl(InliningOptions.ShortMethod)] public ApplyInverseGammaExposureRowIntervalAction( Rectangle bounds, diff --git a/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor{TPixel}.cs index cc48ec474..410b7405c 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor{TPixel}.cs @@ -87,16 +87,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution private readonly Configuration configuration; private readonly bool preserveAlpha; - /// - /// Initializes a new instance of the struct. - /// - /// The target processing bounds for the current instance. - /// The target pixel buffer to adjust. - /// The source pixels. Cannot be null. - /// The vertical kernel operator. - /// The horizontal kernel operator. - /// The - /// Whether the convolution filter is applied to alpha as well as the color channels. [MethodImpl(InliningOptions.ShortMethod)] public RowIntervalAction( Rectangle bounds, diff --git a/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor{TPixel}.cs index 65a0ace36..1be97a4f8 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor{TPixel}.cs @@ -88,15 +88,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution private readonly Configuration configuration; private readonly bool preserveAlpha; - /// - /// Initializes a new instance of the struct. - /// - /// The target processing bounds for the current instance. - /// The target pixel buffer to adjust. - /// The source pixels. Cannot be null. - /// The kernel operator. - /// The - /// Whether the convolution filter is applied to alpha as well as the color channels. [MethodImpl(InliningOptions.ShortMethod)] public RowIntervalAction( Rectangle bounds, diff --git a/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor{TPixel}.cs index 95e5107c7..db7bc5188 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor{TPixel}.cs @@ -77,15 +77,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution private readonly Configuration configuration; private readonly bool preserveAlpha; - /// - /// Initializes a new instance of the struct. - /// - /// The target processing bounds for the current instance. - /// The target pixel buffer to adjust. - /// The source pixels. Cannot be null. - /// The kernel operator. - /// The - /// Whether the convolution filter is applied to alpha as well as the color channels. [MethodImpl(InliningOptions.ShortMethod)] public RowIntervalAction( Rectangle bounds, diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorCompassProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorCompassProcessor{TPixel}.cs index e85205c41..e2480957e 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorCompassProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorCompassProcessor{TPixel}.cs @@ -121,15 +121,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution private readonly int shiftY; private readonly int shiftX; - /// - /// Initializes a new instance of the struct. - /// - /// The target pixel buffer to adjust. - /// The processed pixels for the current iteration. Cannot be null. - /// The minimum horizontal offset. - /// The maximum horizontal offset. - /// The vertical offset shift. - /// The horizontal offset shift. [MethodImpl(InliningOptions.ShortMethod)] public RowIntervalAction( Buffer2D targetPixels, diff --git a/src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor{TPixel}.cs index 32aecbedb..402a05249 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor{TPixel}.cs @@ -17,8 +17,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms internal class AffineTransformProcessor : TransformProcessor where TPixel : struct, IPixel { - private Size targetSize; - private Matrix3x2 transformMatrix; + private readonly Size targetSize; + private readonly Matrix3x2 transformMatrix; private readonly IResampler resampler; /// @@ -58,26 +58,25 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms if (this.resampler is NearestNeighborResampler) { - Rectangle sourceBounds = this.SourceRectangle; - var nearestRowAction = new NearestNeighborRowIntervalAction(ref sourceBounds, ref matrix, width, source, destination); - ParallelRowIterator.IterateRows( targetBounds, configuration, - in nearestRowAction); + new NearestNeighborRowIntervalAction(this.SourceRectangle, ref matrix, width, source, destination)); return; } using var kernelMap = new TransformKernelMap(configuration, source.Size(), destination.Size(), this.resampler); - var rowAction = new RowIntervalAction(configuration, kernelMap, ref matrix, width, source, destination); ParallelRowIterator.IterateRows( targetBounds, configuration, - in rowAction); + new RowIntervalAction(configuration, kernelMap, ref matrix, width, source, destination)); } + /// + /// A implementing the nearest neighbor resampler logic for . + /// private readonly struct NearestNeighborRowIntervalAction : IRowIntervalAction { private readonly Rectangle bounds; @@ -88,7 +87,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms [MethodImpl(InliningOptions.ShortMethod)] public NearestNeighborRowIntervalAction( - ref Rectangle bounds, + Rectangle bounds, ref Matrix3x2 matrix, int maxX, ImageFrame source, @@ -101,6 +100,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms this.destination = destination; } + /// + /// [MethodImpl(InliningOptions.ShortMethod)] public void Invoke(in RowInterval rows) { @@ -120,6 +121,9 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms } } + /// + /// A implementing the transformation logic for . + /// private readonly struct RowIntervalAction : IRowIntervalAction { private readonly Configuration configuration; @@ -146,6 +150,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms this.destination = destination; } + /// [MethodImpl(InliningOptions.ShortMethod)] public void Invoke(in RowInterval rows, Memory memory) {