Browse Source

xmldoc for ResizeWorker

af/merge-core
Anton Firszov 7 years ago
parent
commit
7854901e6a
  1. 3
      src/ImageSharp/Configuration.cs
  2. 15
      src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeWorker.cs

3
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.
/// </summary>
/// <remarks>
/// Currently only used by <see cref="ResizeProcessor{TPixel}"/>.
/// Currently only used by Resize.
/// </remarks>
internal int WorkingBufferSizeHintInBytes { get; set; } = 1 * 1024 * 1024;

15
src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeWorker.cs

@ -14,6 +14,13 @@ using SixLabors.Primitives;
namespace SixLabors.ImageSharp.Processing.Processors.Transforms
{
/// <summary>
/// Implements the resize algorithm using a sliding window of size
/// maximized by <see cref="Configuration.WorkingBufferSizeHintInBytes"/>.
/// 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".
/// </summary>
internal class ResizeWorker<TPixel> : IDisposable
where TPixel : struct, IPixel<TPixel>
{
@ -127,8 +134,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
for (int x = 0; x < this.destWidth; x++)
{
// Span<Vector4> 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<Vector4> GetColumnSpan(int x)
{
return this.transposedFirstPassBuffer.GetRowSpan(x);
}
private void Slide()
{
int minY = this.currentWindow.Max - this.windowBandHeight;

Loading…
Cancel
Save