From bb150bc49913fbe1a8f09e19d1896e03b95db48d Mon Sep 17 00:00:00 2001 From: Drawaes Date: Tue, 25 Apr 2017 23:28:10 +0100 Subject: [PATCH] Added bulk pixel operation for RGB --- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 4ed3fcecb..cf3b657cf 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -657,17 +657,7 @@ namespace ImageSharp.Formats case PngColorType.Rgb: - for (int x = 0; x < this.header.Width; x++) - { - int offset = 1 + (x * this.bytesPerPixel); - - byte r = defilteredScanline[offset]; - byte g = defilteredScanline[offset + this.bytesPerSample]; - byte b = defilteredScanline[offset + (2 * this.bytesPerSample)]; - - color.PackFromBytes(r, g, b, 255); - pixels[x, this.currentRow] = color; - } + BulkPixelOperations.Instance.PackFromXyzBytes(scanlineBuffer, pixelBuffer, this.header.Width); break;