Browse Source

Naming tweaks

js/color-alpha-handling
James Jackson-South 6 years ago
parent
commit
228e2771d6
  1. 6
      src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor{TPixel}.cs
  2. 18
      src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor{TPixel}.cs

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

@ -140,7 +140,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
[MethodImpl(InliningOptions.ShortMethod)] [MethodImpl(InliningOptions.ShortMethod)]
public void Invoke(int y, Span<Vector4> span) public void Invoke(int y, Span<Vector4> span)
{ {
ref Vector4 spanRef = ref MemoryMarshal.GetReference(span); ref Vector4 targetRef = ref MemoryMarshal.GetReference(span);
Span<TPixel> targetRowSpan = this.targetPixels.GetRowSpan(y).Slice(this.bounds.X); Span<TPixel> targetRowSpan = this.targetPixels.GetRowSpan(y).Slice(this.bounds.X);
PixelOperations<TPixel>.Instance.ToVector4(this.configuration, targetRowSpan.Slice(0, span.Length), span); PixelOperations<TPixel>.Instance.ToVector4(this.configuration, targetRowSpan.Slice(0, span.Length), span);
Span<int> yOffsets = this.map.GetYOffsetSpan(); Span<int> yOffsets = this.map.GetYOffsetSpan();
@ -156,7 +156,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
yOffsets, yOffsets,
xOffsets, xOffsets,
this.sourcePixels, this.sourcePixels,
ref spanRef, ref targetRef,
row, row,
column); column);
} }
@ -170,7 +170,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
yOffsets, yOffsets,
xOffsets, xOffsets,
this.sourcePixels, this.sourcePixels,
ref spanRef, ref targetRef,
row, row,
column); column);
} }

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

@ -107,11 +107,11 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
[MethodImpl(InliningOptions.ShortMethod)] [MethodImpl(InliningOptions.ShortMethod)]
public void Invoke(int y, Span<Vector4> span) public void Invoke(int y, Span<Vector4> span)
{ {
ref Vector4 spanRef = ref MemoryMarshal.GetReference(span); ref Vector4 targetRef = ref MemoryMarshal.GetReference(span);
Span<TPixel> targetRowSpan = this.targetPixels.GetRowSpan(y).Slice(this.bounds.X); Span<TPixel> targetRowSpan = this.targetPixels.GetRowSpan(y).Slice(this.bounds.X);
PixelOperations<TPixel>.Instance.ToVector4(this.configuration, targetRowSpan.Slice(0, span.Length), span); PixelOperations<TPixel>.Instance.ToVector4(this.configuration, targetRowSpan.Slice(0, span.Length), span);
Span<int> yOffsetSpan = this.map.GetYOffsetSpan(); Span<int> yOffsets = this.map.GetYOffsetSpan();
Span<int> xOffsetSpan = this.map.GetXOffsetSpan(); Span<int> xOffsets = this.map.GetXOffsetSpan();
int row = y - this.bounds.Y; int row = y - this.bounds.Y;
if (this.preserveAlpha) if (this.preserveAlpha)
@ -120,10 +120,10 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
{ {
DenseMatrixUtils.Convolve3( DenseMatrixUtils.Convolve3(
in this.kernel, in this.kernel,
yOffsetSpan, yOffsets,
xOffsetSpan, xOffsets,
this.sourcePixels, this.sourcePixels,
ref spanRef, ref targetRef,
row, row,
column); column);
} }
@ -134,10 +134,10 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
{ {
DenseMatrixUtils.Convolve4( DenseMatrixUtils.Convolve4(
in this.kernel, in this.kernel,
yOffsetSpan, yOffsets,
xOffsetSpan, xOffsets,
this.sourcePixels, this.sourcePixels,
ref spanRef, ref targetRef,
row, row,
column); column);
} }

Loading…
Cancel
Save