mirror of https://github.com/adamdruppe/arsd.git
load this one bmp irc sent me
This commit is contained in:
parent
32d96ae4e1
commit
f4eb75a1d9
10
bmp.d
10
bmp.d
|
|
@ -421,10 +421,18 @@ MemoryImage readBmpIndirect(scope void delegate(void*, size_t) fread, bool lookF
|
|||
|
||||
return img;
|
||||
} else {
|
||||
if (compression != 0) throw new Exception("invalid bitmap compression");
|
||||
if (compression != 0 && compression != 3) throw new Exception("unsupported bitmap compression");
|
||||
// true color image
|
||||
auto img = new TrueColorImage(width, height);
|
||||
|
||||
if(compression == 3)
|
||||
foreach(idx; 0 .. 3) {
|
||||
// so tbh I don't know what this actually is, it looks like an rgb mask, but why is it here?
|
||||
// is this common or just the one file i happen to have?
|
||||
// is there some header byte im missing?
|
||||
read4();
|
||||
}
|
||||
|
||||
// no palette, so straight into the data
|
||||
int offsetStart = width * height * 4;
|
||||
int bytesPerPixel = 4;
|
||||
|
|
|
|||
Loading…
Reference in New Issue