|
|
|
@ -59,16 +59,14 @@ internal class CropProcessor<TPixel> : TransformProcessor<TPixel> |
|
|
|
|
|
|
|
Rectangle bounds = this.cropRectangle; |
|
|
|
|
|
|
|
// Copying is cheap, we should process more pixels per task:
|
|
|
|
ParallelExecutionSettings parallelSettings = |
|
|
|
ParallelExecutionSettings.FromConfiguration(this.Configuration).MultiplyMinimumPixelsPerTask(4); |
|
|
|
|
|
|
|
// Copying is too cheap to benefit from parallelization;
|
|
|
|
// the overhead exceeds the work per task. See #3111.
|
|
|
|
RowOperation operation = new(bounds, source.PixelBuffer, destination.PixelBuffer); |
|
|
|
|
|
|
|
ParallelRowIterator.IterateRows( |
|
|
|
bounds, |
|
|
|
in parallelSettings, |
|
|
|
in operation); |
|
|
|
for (int y = bounds.Top; y < bounds.Bottom; y++) |
|
|
|
{ |
|
|
|
operation.Invoke(y); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|