|
|
@ -371,15 +371,15 @@ namespace SixLabors.ImageSharp.Formats.Bmp |
|
|
padding = 4 - padding; |
|
|
padding = 4 - padding; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
byte[] row = new byte[arrayWidth + padding]; |
|
|
using (var row = Buffer<byte>.CreateClean(arrayWidth + padding)) |
|
|
|
|
|
{ |
|
|
var color = default(TPixel); |
|
|
var color = default(TPixel); |
|
|
|
|
|
var rgba = new Rgba32(0, 0, 0, 255); |
|
|
var rgba = default(Rgba32); |
|
|
|
|
|
|
|
|
|
|
|
for (int y = 0; y < height; y++) |
|
|
for (int y = 0; y < height; y++) |
|
|
{ |
|
|
{ |
|
|
int newY = Invert(y, height, inverted); |
|
|
int newY = Invert(y, height, inverted); |
|
|
this.currentStream.Read(row, 0, row.Length); |
|
|
this.currentStream.Read(row.Array, 0, row.Length); |
|
|
int offset = 0; |
|
|
int offset = 0; |
|
|
Span<TPixel> pixelRow = pixels.GetRowSpan(newY); |
|
|
Span<TPixel> pixelRow = pixels.GetRowSpan(newY); |
|
|
|
|
|
|
|
|
@ -403,6 +403,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Reads the 16 bit color palette from the stream
|
|
|
/// Reads the 16 bit color palette from the stream
|
|
|
|