|
|
@ -356,8 +356,6 @@ namespace ImageSharp.Formats |
|
|
int interlaceY = 0; // The current interlaced line
|
|
|
int interlaceY = 0; // The current interlaced line
|
|
|
|
|
|
|
|
|
using (PixelAccessor<TColor> pixelAccessor = image.Lock()) |
|
|
using (PixelAccessor<TColor> pixelAccessor = image.Lock()) |
|
|
{ |
|
|
|
|
|
using (PixelArea<TColor> pixelRow = new PixelArea<TColor>(imageWidth, ComponentOrder.XYZW)) |
|
|
|
|
|
{ |
|
|
{ |
|
|
for (int y = descriptor.Top; y < descriptor.Top + descriptor.Height; y++) |
|
|
for (int y = descriptor.Top; y < descriptor.Top + descriptor.Height; y++) |
|
|
{ |
|
|
{ |
|
|
@ -396,10 +394,7 @@ namespace ImageSharp.Formats |
|
|
writeY = y; |
|
|
writeY = y; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pixelAccessor.CopyTo(pixelRow, writeY, descriptor.Left); |
|
|
for (int x = descriptor.Left; x < descriptor.Left + descriptor.Width; x++) |
|
|
|
|
|
|
|
|
byte* pixelBase = pixelRow.PixelBase; |
|
|
|
|
|
for (int x = 0; x < descriptor.Width; x++) |
|
|
|
|
|
{ |
|
|
{ |
|
|
int index = indices[i]; |
|
|
int index = indices[i]; |
|
|
|
|
|
|
|
|
@ -408,23 +403,13 @@ namespace ImageSharp.Formats |
|
|
this.graphicsControlExtension.TransparencyIndex != index) |
|
|
this.graphicsControlExtension.TransparencyIndex != index) |
|
|
{ |
|
|
{ |
|
|
int indexOffset = index * 3; |
|
|
int indexOffset = index * 3; |
|
|
*(pixelBase + 0) = colorTable[indexOffset]; |
|
|
|
|
|
*(pixelBase + 1) = colorTable[indexOffset + 1]; |
|
|
|
|
|
*(pixelBase + 2) = colorTable[indexOffset + 2]; |
|
|
|
|
|
*(pixelBase + 3) = 255; |
|
|
|
|
|
|
|
|
|
|
|
// TODO: This is actually 200us faster in benchmarking.
|
|
|
TColor pixel = default(TColor); |
|
|
// int indexOffset = index * 3;
|
|
|
pixel.PackFromBytes(colorTable[indexOffset], colorTable[indexOffset + 1], colorTable[indexOffset + 2], 255); |
|
|
// TColor pixel = default(TColor);
|
|
|
pixelAccessor[x, writeY] = pixel; |
|
|
// pixel.PackFromBytes(colorTable[indexOffset], colorTable[indexOffset + 1], colorTable[indexOffset + 2], 255);
|
|
|
|
|
|
// currentPixels[x, writeY] = pixel;
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
i++; |
|
|
i++; |
|
|
pixelBase += 4; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pixelAccessor.CopyFrom(pixelRow, writeY, descriptor.Left); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|