Browse Source

avoid local variable copy when the original is never changed

pull/771/head
Peter Amrehn 8 years ago
committed by Unknown
parent
commit
34481a645a
  1. 3
      src/ImageSharp/Formats/Png/PngScanlineProcessor.cs

3
src/ImageSharp/Formats/Png/PngScanlineProcessor.cs

@ -190,12 +190,11 @@ namespace SixLabors.ImageSharp.Formats.Png
else
{
Rgba32 rgba32 = default;
int bps = bytesPerSample;
for (int x = 0; x < header.Width; x++)
{
int offset = x * bytesPerPixel;
byte luminance = Unsafe.Add(ref scanlineSpanRef, offset);
byte alpha = Unsafe.Add(ref scanlineSpanRef, offset + bps);
byte alpha = Unsafe.Add(ref scanlineSpanRef, offset + bytesPerSample);
rgba32.R = luminance;
rgba32.G = luminance;

Loading…
Cancel
Save