Browse Source

Naming tweaks

js/color-alpha-handling
James Jackson-South 5 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)]
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);
PixelOperations<TPixel>.Instance.ToVector4(this.configuration, targetRowSpan.Slice(0, span.Length), span);
Span<int> yOffsets = this.map.GetYOffsetSpan();
@ -156,7 +156,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
yOffsets,
xOffsets,
this.sourcePixels,
ref spanRef,
ref targetRef,
row,
column);
}
@ -170,7 +170,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Convolution
yOffsets,
xOffsets,
this.sourcePixels,
ref spanRef,
ref targetRef,
row,
column);
}

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

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

Loading…
Cancel
Save