From 94b52bff22e9654bd017100cda6b91a4002d4bf3 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Sat, 20 Apr 2019 02:15:38 +0200 Subject: [PATCH] xmldoc for ResizeWorker --- src/ImageSharp/Configuration.cs | 3 +-- .../Processors/Transforms/Resize/ResizeWorker.cs | 15 +++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs index 7cb014563d..4e8284c2cd 100644 --- a/src/ImageSharp/Configuration.cs +++ b/src/ImageSharp/Configuration.cs @@ -10,7 +10,6 @@ using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.IO; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Memory; namespace SixLabors.ImageSharp @@ -108,7 +107,7 @@ namespace SixLabors.ImageSharp /// The default value is 1MB. /// /// - /// Currently only used by . + /// Currently only used by Resize. /// internal int WorkingBufferSizeHintInBytes { get; set; } = 1 * 1024 * 1024; diff --git a/src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeWorker.cs b/src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeWorker.cs index 7fe2638802..00a8cfbf3d 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeWorker.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeWorker.cs @@ -14,6 +14,13 @@ using SixLabors.Primitives; namespace SixLabors.ImageSharp.Processing.Processors.Transforms { + /// + /// Implements the resize algorithm using a sliding window of size + /// maximized by . + /// The height of the window is a multiple of the vertical kernel's maximum diameter. + /// When sliding the window, the contents of the bottom window band are copied to the new top band. + /// For more details, and visual explanation, see "ResizeWorker.pptx". + /// internal class ResizeWorker : IDisposable where TPixel : struct, IPixel { @@ -127,8 +134,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms for (int x = 0; x < this.destWidth; x++) { - // Span firstPassColumn = this.GetColumnSpan(x).Slice(top); - // ref Vector4 firstPassColumnBase = ref this.GetColumnSpan(x)[top]; ref Vector4 firstPassColumnBase = ref Unsafe.Add(ref fpBase, x * this.workerHeight); // Destination color components @@ -141,12 +146,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private Span GetColumnSpan(int x) - { - return this.transposedFirstPassBuffer.GetRowSpan(x); - } - private void Slide() { int minY = this.currentWindow.Max - this.windowBandHeight;