Browse Source

Renamed ParallelRowIterator.IterateRows to IterateRowIntervals

pull/1132/head
Sergio Pedri 6 years ago
parent
commit
82b07abc62
  1. 12
      src/ImageSharp/Advanced/ParallelRowIterator.cs
  2. 2
      src/ImageSharp/ImageFrame{TPixel}.cs
  3. 2
      src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor{TPixel}.cs
  4. 8
      src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs
  5. 2
      src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor{TPixel}.cs
  6. 4
      src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor{TPixel}.cs
  7. 2
      src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor{TPixel}.cs
  8. 2
      src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorCompassProcessor{TPixel}.cs
  9. 4
      src/ImageSharp/Processing/Processors/Dithering/OrderedDither.cs
  10. 2
      src/ImageSharp/Processing/Processors/Drawing/DrawImageProcessor{TPixelBg,TPixelFg}.cs
  11. 2
      src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs
  12. 2
      src/ImageSharp/Processing/Processors/Effects/PixelRowDelegateProcessor{TPixel,TDelegate}.cs
  13. 2
      src/ImageSharp/Processing/Processors/Filters/FilterProcessor{TPixel}.cs
  14. 4
      src/ImageSharp/Processing/Processors/Normalization/AdaptiveHistogramEqualizationProcessor{TPixel}.cs
  15. 4
      src/ImageSharp/Processing/Processors/Normalization/GlobalHistogramEqualizationProcessor{TPixel}.cs
  16. 2
      src/ImageSharp/Processing/Processors/Overlays/BackgroundColorProcessor{TPixel}.cs
  17. 2
      src/ImageSharp/Processing/Processors/Overlays/GlowProcessor{TPixel}.cs
  18. 2
      src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor{TPixel}.cs
  19. 2
      src/ImageSharp/Processing/Processors/Quantization/FrameQuantizerExtensions.cs
  20. 2
      src/ImageSharp/Processing/Processors/Quantization/QuantizeProcessor{TPixel}.cs
  21. 2
      src/ImageSharp/Processing/Processors/Transforms/CropProcessor{TPixel}.cs
  22. 4
      src/ImageSharp/Processing/Processors/Transforms/Linear/AffineTransformProcessor{TPixel}.cs
  23. 2
      src/ImageSharp/Processing/Processors/Transforms/Linear/FlipProcessor{TPixel}.cs
  24. 4
      src/ImageSharp/Processing/Processors/Transforms/Linear/ProjectiveTransformProcessor{TPixel}.cs
  25. 6
      src/ImageSharp/Processing/Processors/Transforms/Linear/RotateProcessor{TPixel}.cs
  26. 2
      src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeProcessor{TPixel}.cs
  27. 18
      tests/ImageSharp.Tests/Helpers/ParallelRowIteratorTests.cs
  28. 2
      tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs

12
src/ImageSharp/Advanced/ParallelRowIterator.cs

@ -25,11 +25,11 @@ namespace SixLabors.ImageSharp.Advanced
/// <param name="rectangle">The <see cref="Rectangle"/>.</param> /// <param name="rectangle">The <see cref="Rectangle"/>.</param>
/// <param name="operation">The operation defining the iteration logic on a single <see cref="RowInterval"/>.</param> /// <param name="operation">The operation defining the iteration logic on a single <see cref="RowInterval"/>.</param>
[MethodImpl(InliningOptions.ShortMethod)] [MethodImpl(InliningOptions.ShortMethod)]
public static void IterateRows<T>(Configuration configuration, Rectangle rectangle, in T operation) public static void IterateRowIntervals<T>(Configuration configuration, Rectangle rectangle, in T operation)
where T : struct, IRowIntervalOperation where T : struct, IRowIntervalOperation
{ {
var parallelSettings = ParallelExecutionSettings.FromConfiguration(configuration); var parallelSettings = ParallelExecutionSettings.FromConfiguration(configuration);
IterateRows(rectangle, in parallelSettings, in operation); IterateRowIntervals(rectangle, in parallelSettings, in operation);
} }
/// <summary> /// <summary>
@ -39,7 +39,7 @@ namespace SixLabors.ImageSharp.Advanced
/// <param name="rectangle">The <see cref="Rectangle"/>.</param> /// <param name="rectangle">The <see cref="Rectangle"/>.</param>
/// <param name="parallelSettings">The <see cref="ParallelExecutionSettings"/>.</param> /// <param name="parallelSettings">The <see cref="ParallelExecutionSettings"/>.</param>
/// <param name="operation">The operation defining the iteration logic on a single <see cref="RowInterval"/>.</param> /// <param name="operation">The operation defining the iteration logic on a single <see cref="RowInterval"/>.</param>
public static void IterateRows<T>( public static void IterateRowIntervals<T>(
Rectangle rectangle, Rectangle rectangle,
in ParallelExecutionSettings parallelSettings, in ParallelExecutionSettings parallelSettings,
in T operation) in T operation)
@ -84,12 +84,12 @@ namespace SixLabors.ImageSharp.Advanced
/// <param name="configuration">The <see cref="Configuration"/> to get the parallel settings from.</param> /// <param name="configuration">The <see cref="Configuration"/> to get the parallel settings from.</param>
/// <param name="rectangle">The <see cref="Rectangle"/>.</param> /// <param name="rectangle">The <see cref="Rectangle"/>.</param>
/// <param name="operation">The operation defining the iteration logic on a single <see cref="RowInterval"/>.</param> /// <param name="operation">The operation defining the iteration logic on a single <see cref="RowInterval"/>.</param>
public static void IterateRows<T, TBuffer>(Configuration configuration, Rectangle rectangle, in T operation) public static void IterateRowIntervals<T, TBuffer>(Configuration configuration, Rectangle rectangle, in T operation)
where T : struct, IRowIntervalOperation<TBuffer> where T : struct, IRowIntervalOperation<TBuffer>
where TBuffer : unmanaged where TBuffer : unmanaged
{ {
var parallelSettings = ParallelExecutionSettings.FromConfiguration(configuration); var parallelSettings = ParallelExecutionSettings.FromConfiguration(configuration);
IterateRows<T, TBuffer>(rectangle, in parallelSettings, in operation); IterateRowIntervals<T, TBuffer>(rectangle, in parallelSettings, in operation);
} }
/// <summary> /// <summary>
@ -101,7 +101,7 @@ namespace SixLabors.ImageSharp.Advanced
/// <param name="rectangle">The <see cref="Rectangle"/>.</param> /// <param name="rectangle">The <see cref="Rectangle"/>.</param>
/// <param name="parallelSettings">The <see cref="ParallelExecutionSettings"/>.</param> /// <param name="parallelSettings">The <see cref="ParallelExecutionSettings"/>.</param>
/// <param name="operation">The operation defining the iteration logic on a single <see cref="RowInterval"/>.</param> /// <param name="operation">The operation defining the iteration logic on a single <see cref="RowInterval"/>.</param>
public static void IterateRows<T, TBuffer>( public static void IterateRowIntervals<T, TBuffer>(
Rectangle rectangle, Rectangle rectangle,
in ParallelExecutionSettings parallelSettings, in ParallelExecutionSettings parallelSettings,
in T operation) in T operation)

2
src/ImageSharp/ImageFrame{TPixel}.cs

@ -277,7 +277,7 @@ namespace SixLabors.ImageSharp
var target = new ImageFrame<TPixel2>(configuration, this.Width, this.Height, this.Metadata.DeepClone()); var target = new ImageFrame<TPixel2>(configuration, this.Width, this.Height, this.Metadata.DeepClone());
var operation = new RowIntervalOperation<TPixel2>(this, target, configuration); var operation = new RowIntervalOperation<TPixel2>(this, target, configuration);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
this.Bounds(), this.Bounds(),
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor{TPixel}.cs

@ -45,7 +45,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Binarization
bool isAlphaOnly = typeof(TPixel) == typeof(A8); bool isAlphaOnly = typeof(TPixel) == typeof(A8);
var operation = new RowIntervalOperation(interest, source, upper, lower, threshold, isAlphaOnly); var operation = new RowIntervalOperation(interest, source, upper, lower, threshold, isAlphaOnly);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
interest, interest,
in operation); in operation);

8
src/ImageSharp/Processing/Processors/Convolution/BokehBlurProcessor{TPixel}.cs

@ -73,7 +73,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
{ {
// Preliminary gamma highlight pass // Preliminary gamma highlight pass
var gammaOperation = new ApplyGammaExposureRowIntervalOperation(this.SourceRectangle, source.PixelBuffer, this.Configuration, this.gamma); var gammaOperation = new ApplyGammaExposureRowIntervalOperation(this.SourceRectangle, source.PixelBuffer, this.Configuration, this.gamma);
ParallelRowIterator.IterateRows<ApplyGammaExposureRowIntervalOperation, Vector4>( ParallelRowIterator.IterateRowIntervals<ApplyGammaExposureRowIntervalOperation, Vector4>(
this.Configuration, this.Configuration,
this.SourceRectangle, this.SourceRectangle,
in gammaOperation); in gammaOperation);
@ -88,7 +88,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
// Apply the inverse gamma exposure pass, and write the final pixel data // Apply the inverse gamma exposure pass, and write the final pixel data
var operation = new ApplyInverseGammaExposureRowIntervalOperation(this.SourceRectangle, source.PixelBuffer, processingBuffer, this.Configuration, inverseGamma); var operation = new ApplyInverseGammaExposureRowIntervalOperation(this.SourceRectangle, source.PixelBuffer, processingBuffer, this.Configuration, inverseGamma);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
this.Configuration, this.Configuration,
this.SourceRectangle, this.SourceRectangle,
in operation); in operation);
@ -121,14 +121,14 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
// Compute the vertical 1D convolution // Compute the vertical 1D convolution
var verticalOperation = new ApplyVerticalConvolutionRowIntervalOperation(sourceRectangle, firstPassBuffer, source.PixelBuffer, kernel); var verticalOperation = new ApplyVerticalConvolutionRowIntervalOperation(sourceRectangle, firstPassBuffer, source.PixelBuffer, kernel);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
sourceRectangle, sourceRectangle,
in verticalOperation); in verticalOperation);
// Compute the horizontal 1D convolutions and accumulate the partial results on the target buffer // Compute the horizontal 1D convolutions and accumulate the partial results on the target buffer
var horizontalOperation = new ApplyHorizontalConvolutionRowIntervalOperation(sourceRectangle, processingBuffer, firstPassBuffer, kernel, parameters.Z, parameters.W); var horizontalOperation = new ApplyHorizontalConvolutionRowIntervalOperation(sourceRectangle, processingBuffer, firstPassBuffer, kernel, parameters.Z, parameters.W);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
sourceRectangle, sourceRectangle,
in horizontalOperation); in horizontalOperation);

2
src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor{TPixel}.cs

@ -67,7 +67,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds()); var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds());
var operation = new RowIntervalOperation(interest, targetPixels, source.PixelBuffer, this.KernelY, this.KernelX, this.Configuration, this.PreserveAlpha); var operation = new RowIntervalOperation(interest, targetPixels, source.PixelBuffer, this.KernelY, this.KernelX, this.Configuration, this.PreserveAlpha);
ParallelRowIterator.IterateRows<RowIntervalOperation, Vector4>( ParallelRowIterator.IterateRowIntervals<RowIntervalOperation, Vector4>(
this.Configuration, this.Configuration,
interest, interest,
in operation); in operation);

4
src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor{TPixel}.cs

@ -65,14 +65,14 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
// Horizontal convolution // Horizontal convolution
var horizontalOperation = new RowIntervalOperation(interest, firstPassPixels, source.PixelBuffer, this.KernelX, this.Configuration, this.PreserveAlpha); var horizontalOperation = new RowIntervalOperation(interest, firstPassPixels, source.PixelBuffer, this.KernelX, this.Configuration, this.PreserveAlpha);
ParallelRowIterator.IterateRows<RowIntervalOperation, Vector4>( ParallelRowIterator.IterateRowIntervals<RowIntervalOperation, Vector4>(
this.Configuration, this.Configuration,
interest, interest,
in horizontalOperation); in horizontalOperation);
// Vertical convolution // Vertical convolution
var verticalOperation = new RowIntervalOperation(interest, source.PixelBuffer, firstPassPixels, this.KernelY, this.Configuration, this.PreserveAlpha); var verticalOperation = new RowIntervalOperation(interest, source.PixelBuffer, firstPassPixels, this.KernelY, this.Configuration, this.PreserveAlpha);
ParallelRowIterator.IterateRows<RowIntervalOperation, Vector4>( ParallelRowIterator.IterateRowIntervals<RowIntervalOperation, Vector4>(
this.Configuration, this.Configuration,
interest, interest,
in verticalOperation); in verticalOperation);

2
src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor{TPixel}.cs

@ -57,7 +57,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds()); var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds());
var operation = new RowIntervalOperation(interest, targetPixels, source.PixelBuffer, this.KernelXY, this.Configuration, this.PreserveAlpha); var operation = new RowIntervalOperation(interest, targetPixels, source.PixelBuffer, this.KernelXY, this.Configuration, this.PreserveAlpha);
ParallelRowIterator.IterateRows<RowIntervalOperation, Vector4>( ParallelRowIterator.IterateRowIntervals<RowIntervalOperation, Vector4>(
this.Configuration, this.Configuration,
interest, interest,
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorCompassProcessor{TPixel}.cs

@ -79,7 +79,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
} }
var operation = new RowIntervalOperation(source.PixelBuffer, pass.PixelBuffer, interest); var operation = new RowIntervalOperation(source.PixelBuffer, pass.PixelBuffer, interest);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
this.Configuration, this.Configuration,
interest, interest,
in operation); in operation);

4
src/ImageSharp/Processing/Processors/Dithering/OrderedDither.cs

@ -121,7 +121,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Dithering
palette, palette,
ImageMaths.GetBitsNeededForColorDepth(palette.Span.Length)); ImageMaths.GetBitsNeededForColorDepth(palette.Span.Length));
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
quantizer.Configuration, quantizer.Configuration,
bounds, bounds,
in ditherOperation); in ditherOperation);
@ -145,7 +145,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Dithering
scale, scale,
ImageMaths.GetBitsNeededForColorDepth(palette.Span.Length)); ImageMaths.GetBitsNeededForColorDepth(palette.Span.Length));
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
bounds, bounds,
in ditherOperation); in ditherOperation);

2
src/ImageSharp/Processing/Processors/Drawing/DrawImageProcessor{TPixelBg,TPixelFg}.cs

@ -100,7 +100,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Drawing
} }
var operation = new RowIntervalOperation(source, targetImage, blender, configuration, minX, width, locationY, targetX, this.Opacity); var operation = new RowIntervalOperation(source, targetImage, blender, configuration, minX, width, locationY, targetX, this.Opacity);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
workingRect, workingRect,
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs

@ -48,7 +48,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects
source.CopyTo(targetPixels); source.CopyTo(targetPixels);
var operation = new RowIntervalOperation(this.SourceRectangle, targetPixels, source, this.Configuration, brushSize >> 1, this.definition.Levels); var operation = new RowIntervalOperation(this.SourceRectangle, targetPixels, source, this.Configuration, brushSize >> 1, this.definition.Levels);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
this.Configuration, this.Configuration,
this.SourceRectangle, this.SourceRectangle,
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Effects/PixelRowDelegateProcessor{TPixel,TDelegate}.cs

@ -52,7 +52,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects
var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds()); var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds());
var operation = new RowIntervalOperation(interest.X, source, this.Configuration, this.modifiers, this.rowDelegate); var operation = new RowIntervalOperation(interest.X, source, this.Configuration, this.modifiers, this.rowDelegate);
ParallelRowIterator.IterateRows<RowIntervalOperation, Vector4>( ParallelRowIterator.IterateRowIntervals<RowIntervalOperation, Vector4>(
this.Configuration, this.Configuration,
interest, interest,
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Filters/FilterProcessor{TPixel}.cs

@ -38,7 +38,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Filters
var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds()); var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds());
var operation = new RowIntervalOperation(interest.X, source, this.definition.Matrix, this.Configuration); var operation = new RowIntervalOperation(interest.X, source, this.definition.Matrix, this.Configuration);
ParallelRowIterator.IterateRows<RowIntervalOperation, Vector4>( ParallelRowIterator.IterateRowIntervals<RowIntervalOperation, Vector4>(
this.Configuration, this.Configuration,
interest, interest,
in operation); in operation);

4
src/ImageSharp/Processing/Processors/Normalization/AdaptiveHistogramEqualizationProcessor{TPixel}.cs

@ -81,7 +81,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Normalization
} }
var operation = new RowIntervalOperation(cdfData, tileYStartPositions, tileWidth, tileHeight, tileCount, halfTileWidth, luminanceLevels, source); var operation = new RowIntervalOperation(cdfData, tileYStartPositions, tileWidth, tileHeight, tileCount, halfTileWidth, luminanceLevels, source);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
this.Configuration, this.Configuration,
new Rectangle(0, 0, sourceWidth, tileYStartPositions.Count), new Rectangle(0, 0, sourceWidth, tileYStartPositions.Count),
in operation); in operation);
@ -522,7 +522,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Normalization
this.luminanceLevels, this.luminanceLevels,
source); source);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
this.configuration, this.configuration,
new Rectangle(0, 0, this.sourceWidth, this.tileYStartPositions.Count), new Rectangle(0, 0, this.sourceWidth, this.tileYStartPositions.Count),
in operation); in operation);

4
src/ImageSharp/Processing/Processors/Normalization/GlobalHistogramEqualizationProcessor{TPixel}.cs

@ -53,7 +53,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Normalization
// Build the histogram of the grayscale levels // Build the histogram of the grayscale levels
var grayscaleOperation = new GrayscaleLevelsRowIntervalOperation(interest, histogramBuffer, source, this.LuminanceLevels); var grayscaleOperation = new GrayscaleLevelsRowIntervalOperation(interest, histogramBuffer, source, this.LuminanceLevels);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
this.Configuration, this.Configuration,
interest, interest,
in grayscaleOperation); in grayscaleOperation);
@ -76,7 +76,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Normalization
// Apply the cdf to each pixel of the image // Apply the cdf to each pixel of the image
var cdfOperation = new CdfApplicationRowIntervalOperation(interest, cdfBuffer, source, this.LuminanceLevels, numberOfPixelsMinusCdfMin); var cdfOperation = new CdfApplicationRowIntervalOperation(interest, cdfBuffer, source, this.LuminanceLevels, numberOfPixelsMinusCdfMin);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
this.Configuration, this.Configuration,
interest, interest,
in cdfOperation); in cdfOperation);

2
src/ImageSharp/Processing/Processors/Overlays/BackgroundColorProcessor{TPixel}.cs

@ -50,7 +50,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Overlays
PixelBlender<TPixel> blender = PixelOperations<TPixel>.Instance.GetPixelBlender(graphicsOptions); PixelBlender<TPixel> blender = PixelOperations<TPixel>.Instance.GetPixelBlender(graphicsOptions);
var operation = new RowIntervalOperation(configuration, interest, blender, amount, colors, source); var operation = new RowIntervalOperation(configuration, interest, blender, amount, colors, source);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
interest, interest,
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Overlays/GlowProcessor{TPixel}.cs

@ -56,7 +56,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Overlays
rowColors.GetSpan().Fill(glowColor); rowColors.GetSpan().Fill(glowColor);
var operation = new RowIntervalOperation(configuration, interest, rowColors, this.blender, center, maxDistance, blendPercent, source); var operation = new RowIntervalOperation(configuration, interest, rowColors, this.blender, center, maxDistance, blendPercent, source);
ParallelRowIterator.IterateRows<RowIntervalOperation, float>( ParallelRowIterator.IterateRowIntervals<RowIntervalOperation, float>(
configuration, configuration,
interest, interest,
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor{TPixel}.cs

@ -64,7 +64,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Overlays
rowColors.GetSpan().Fill(vignetteColor); rowColors.GetSpan().Fill(vignetteColor);
var operation = new RowIntervalOperation(configuration, interest, rowColors, this.blender, center, maxDistance, blendPercent, source); var operation = new RowIntervalOperation(configuration, interest, rowColors, this.blender, center, maxDistance, blendPercent, source);
ParallelRowIterator.IterateRows<RowIntervalOperation, float>( ParallelRowIterator.IterateRowIntervals<RowIntervalOperation, float>(
configuration, configuration,
interest, interest,
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Quantization/FrameQuantizerExtensions.cs

@ -74,7 +74,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Quantization
if (dither is null) if (dither is null)
{ {
var operation = new RowIntervalOperation<TFrameQuantizer, TPixel>(quantizer, source, output, bounds, palette); var operation = new RowIntervalOperation<TFrameQuantizer, TPixel>(quantizer, source, output, bounds, palette);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
quantizer.Configuration, quantizer.Configuration,
bounds, bounds,
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Quantization/QuantizeProcessor{TPixel}.cs

@ -42,7 +42,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Quantization
using QuantizedFrame<TPixel> quantized = frameQuantizer.QuantizeFrame(source, interest); using QuantizedFrame<TPixel> quantized = frameQuantizer.QuantizeFrame(source, interest);
var operation = new RowIntervalOperation(this.SourceRectangle, source, quantized); var operation = new RowIntervalOperation(this.SourceRectangle, source, quantized);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
interest, interest,
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Transforms/CropProcessor{TPixel}.cs

@ -53,7 +53,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
var operation = new RowIntervalOperation(bounds, source, destination); var operation = new RowIntervalOperation(bounds, source, destination);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
bounds, bounds,
in parallelSettings, in parallelSettings,
in operation); in operation);

4
src/ImageSharp/Processing/Processors/Transforms/Linear/AffineTransformProcessor{TPixel}.cs

@ -72,7 +72,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
if (sampler is NearestNeighborResampler) if (sampler is NearestNeighborResampler)
{ {
var nnOperation = new NNAffineOperation(source, destination, matrix); var nnOperation = new NNAffineOperation(source, destination, matrix);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
destination.Bounds(), destination.Bounds(),
in nnOperation); in nnOperation);
@ -105,7 +105,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
radialExtents, radialExtents,
maxSourceExtents); maxSourceExtents);
ParallelRowIterator.IterateRows<AffineOperation<TResampler>, Vector4>( ParallelRowIterator.IterateRowIntervals<AffineOperation<TResampler>, Vector4>(
configuration, configuration,
destination.Bounds(), destination.Bounds(),
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Transforms/Linear/FlipProcessor{TPixel}.cs

@ -77,7 +77,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
private void FlipY(ImageFrame<TPixel> source, Configuration configuration) private void FlipY(ImageFrame<TPixel> source, Configuration configuration)
{ {
var operation = new RowIntervalOperation(source); var operation = new RowIntervalOperation(source);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
source.Bounds(), source.Bounds(),
in operation); in operation);

4
src/ImageSharp/Processing/Processors/Transforms/Linear/ProjectiveTransformProcessor{TPixel}.cs

@ -72,7 +72,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
if (sampler is NearestNeighborResampler) if (sampler is NearestNeighborResampler)
{ {
var nnOperation = new NNProjectiveOperation(source, destination, matrix); var nnOperation = new NNProjectiveOperation(source, destination, matrix);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
destination.Bounds(), destination.Bounds(),
in nnOperation); in nnOperation);
@ -105,7 +105,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
radialExtents, radialExtents,
maxSourceExtents); maxSourceExtents);
ParallelRowIterator.IterateRows<ProjectiveOperation<TResampler>, Vector4>( ParallelRowIterator.IterateRowIntervals<ProjectiveOperation<TResampler>, Vector4>(
configuration, configuration,
destination.Bounds(), destination.Bounds(),
in operation); in operation);

6
src/ImageSharp/Processing/Processors/Transforms/Linear/RotateProcessor{TPixel}.cs

@ -132,7 +132,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
private void Rotate180(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Configuration configuration) private void Rotate180(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Configuration configuration)
{ {
var operation = new Rotate180RowIntervalOperation(source.Width, source.Height, source, destination); var operation = new Rotate180RowIntervalOperation(source.Width, source.Height, source, destination);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
source.Bounds(), source.Bounds(),
in operation); in operation);
@ -147,7 +147,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
private void Rotate270(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Configuration configuration) private void Rotate270(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Configuration configuration)
{ {
var operation = new Rotate270RowIntervalOperation(destination.Bounds(), source.Width, source.Height, source, destination); var operation = new Rotate270RowIntervalOperation(destination.Bounds(), source.Width, source.Height, source, destination);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
source.Bounds(), source.Bounds(),
in operation); in operation);
@ -162,7 +162,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
private void Rotate90(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Configuration configuration) private void Rotate90(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Configuration configuration)
{ {
var operation = new Rotate90RowIntervalOperation(destination.Bounds(), source.Width, source.Height, source, destination); var operation = new Rotate90RowIntervalOperation(destination.Bounds(), source.Width, source.Height, source, destination);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
source.Bounds(), source.Bounds(),
in operation); in operation);

2
src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeProcessor{TPixel}.cs

@ -152,7 +152,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
source, source,
destination); destination);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
configuration, configuration,
interest, interest,
in operation); in operation);

18
tests/ImageSharp.Tests/Helpers/ParallelRowIteratorTests.cs

@ -78,7 +78,7 @@ namespace SixLabors.ImageSharp.Tests.Helpers
var operation = new TestRowIntervalOperation(RowAction); var operation = new TestRowIntervalOperation(RowAction);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
rectangle, rectangle,
in parallelSettings, in parallelSettings,
in operation); in operation);
@ -116,7 +116,7 @@ namespace SixLabors.ImageSharp.Tests.Helpers
var operation = new TestRowIntervalOperation(RowAction); var operation = new TestRowIntervalOperation(RowAction);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
rectangle, rectangle,
in parallelSettings, in parallelSettings,
in operation); in operation);
@ -157,7 +157,7 @@ namespace SixLabors.ImageSharp.Tests.Helpers
var operation = new TestRowIntervalOperation<Vector4>(RowAction); var operation = new TestRowIntervalOperation<Vector4>(RowAction);
ParallelRowIterator.IterateRows<TestRowIntervalOperation<Vector4>, Vector4>( ParallelRowIterator.IterateRowIntervals<TestRowIntervalOperation<Vector4>, Vector4>(
rectangle, rectangle,
in parallelSettings, in parallelSettings,
in operation); in operation);
@ -195,7 +195,7 @@ namespace SixLabors.ImageSharp.Tests.Helpers
var operation = new TestRowIntervalOperation<Vector4>(RowAction); var operation = new TestRowIntervalOperation<Vector4>(RowAction);
ParallelRowIterator.IterateRows<TestRowIntervalOperation<Vector4>, Vector4>( ParallelRowIterator.IterateRowIntervals<TestRowIntervalOperation<Vector4>, Vector4>(
rectangle, rectangle,
in parallelSettings, in parallelSettings,
in operation); in operation);
@ -249,7 +249,7 @@ namespace SixLabors.ImageSharp.Tests.Helpers
var operation = new TestRowIntervalOperation(RowAction); var operation = new TestRowIntervalOperation(RowAction);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
rectangle, rectangle,
in parallelSettings, in parallelSettings,
in operation); in operation);
@ -291,7 +291,7 @@ namespace SixLabors.ImageSharp.Tests.Helpers
var operation = new TestRowIntervalOperation<Vector4>(RowAction); var operation = new TestRowIntervalOperation<Vector4>(RowAction);
ParallelRowIterator.IterateRows<TestRowIntervalOperation<Vector4>, Vector4>( ParallelRowIterator.IterateRowIntervals<TestRowIntervalOperation<Vector4>, Vector4>(
rectangle, rectangle,
in parallelSettings, in parallelSettings,
in operation); in operation);
@ -355,7 +355,7 @@ namespace SixLabors.ImageSharp.Tests.Helpers
var operation = new TestRowIntervalOperation(RowAction); var operation = new TestRowIntervalOperation(RowAction);
ParallelRowIterator.IterateRows( ParallelRowIterator.IterateRowIntervals(
rect, rect,
settings, settings,
in operation); in operation);
@ -383,7 +383,7 @@ namespace SixLabors.ImageSharp.Tests.Helpers
var operation = new TestRowIntervalOperation(RowAction); var operation = new TestRowIntervalOperation(RowAction);
ArgumentOutOfRangeException ex = Assert.Throws<ArgumentOutOfRangeException>( ArgumentOutOfRangeException ex = Assert.Throws<ArgumentOutOfRangeException>(
() => ParallelRowIterator.IterateRows(rect, in parallelSettings, in operation)); () => ParallelRowIterator.IterateRowIntervals(rect, in parallelSettings, in operation));
Assert.Contains(width <= 0 ? "Width" : "Height", ex.Message); Assert.Contains(width <= 0 ? "Width" : "Height", ex.Message);
} }
@ -406,7 +406,7 @@ namespace SixLabors.ImageSharp.Tests.Helpers
var operation = new TestRowIntervalOperation<Rgba32>(RowAction); var operation = new TestRowIntervalOperation<Rgba32>(RowAction);
ArgumentOutOfRangeException ex = Assert.Throws<ArgumentOutOfRangeException>( ArgumentOutOfRangeException ex = Assert.Throws<ArgumentOutOfRangeException>(
() => ParallelRowIterator.IterateRows<TestRowIntervalOperation<Rgba32>, Rgba32>(rect, in parallelSettings, in operation)); () => ParallelRowIterator.IterateRowIntervals<TestRowIntervalOperation<Rgba32>, Rgba32>(rect, in parallelSettings, in operation));
Assert.Contains(width <= 0 ? "Width" : "Height", ex.Message); Assert.Contains(width <= 0 ? "Width" : "Height", ex.Message);
} }

2
tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs

@ -713,7 +713,7 @@ namespace SixLabors.ImageSharp.Tests
var operation = new RowOperation(configuration, sourceRectangle, source); var operation = new RowOperation(configuration, sourceRectangle, source);
ParallelRowIterator.IterateRows<RowOperation, Vector4>( ParallelRowIterator.IterateRowIntervals<RowOperation, Vector4>(
configuration, configuration,
sourceRectangle, sourceRectangle,
in operation); in operation);

Loading…
Cancel
Save