|
|
|
@ -98,9 +98,14 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder |
|
|
|
|
|
|
|
int pixelBufferLastVerticalIndex = this.pixelBuffer.Height - 1; |
|
|
|
|
|
|
|
// Pixel strides must be padded with the last pixel of the stride
|
|
|
|
int paddingStartIndex = this.pixelBuffer.Width; |
|
|
|
int paddedPixelsCount = this.alignedPixelWidth - this.pixelBuffer.Width; |
|
|
|
|
|
|
|
Span<float> rLane = this.redLane.GetSpan(); |
|
|
|
Span<float> gLane = this.greenLane.GetSpan(); |
|
|
|
Span<float> bLane = this.blueLane.GetSpan(); |
|
|
|
|
|
|
|
for (int yy = start; yy < end; yy++) |
|
|
|
{ |
|
|
|
int y = yy - this.pixelRowCounter; |
|
|
|
@ -110,6 +115,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder |
|
|
|
Span<TPixel> sourceRow = this.pixelBuffer.DangerousGetRowSpan(srcIndex); |
|
|
|
PixelOperations<TPixel>.Instance.UnpackIntoRgbPlanes(rLane, gLane, bLane, sourceRow); |
|
|
|
|
|
|
|
rLane.Slice(paddingStartIndex).Fill(rLane[paddingStartIndex - 1]); |
|
|
|
gLane.Slice(paddingStartIndex).Fill(gLane[paddingStartIndex - 1]); |
|
|
|
bLane.Slice(paddingStartIndex).Fill(bLane[paddingStartIndex - 1]); |
|
|
|
|
|
|
|
// Convert from rgb24 to target pixel type
|
|
|
|
var values = new JpegColorConverterBase.ComponentValues(this.componentProcessors, y); |
|
|
|
this.colorConverter.ConvertFromRgb(values, rLane, gLane, bLane); |
|
|
|
|