mirror of
https://github.com/jorio/Pomme.git
synced 2025-01-15 10:33:03 +00:00
PICT: more accurate 5-5-5 to 8-8-8 RGB conversion
This commit is contained in:
parent
5ae74f079d
commit
1b0ea49ded
@ -189,10 +189,14 @@ static ARGBPixmap Unpack3(BigEndianIStream& f, int w, int h, UInt16 rowbytes)
|
|||||||
LOG << "Chunky16 to RGBA";
|
LOG << "Chunky16 to RGBA";
|
||||||
for (UInt16 px : unpacked)
|
for (UInt16 px : unpacked)
|
||||||
{
|
{
|
||||||
|
UInt8 r = ((px >> 10) & 0b11111) * 255 / 31;
|
||||||
|
UInt8 g = ((px >> 5) & 0b11111) * 255 / 31;
|
||||||
|
UInt8 b = ((px >> 0) & 0b11111) * 255 / 31;
|
||||||
|
|
||||||
dst.data.push_back(0xFF); // a
|
dst.data.push_back(0xFF); // a
|
||||||
dst.data.push_back(((px >> 10) & 0x1F) << 3); // r
|
dst.data.push_back(r);
|
||||||
dst.data.push_back(((px >> 5) & 0x1F) << 3); // g
|
dst.data.push_back(g);
|
||||||
dst.data.push_back(((px >> 0) & 0x1F) << 3); // b
|
dst.data.push_back(b);
|
||||||
}
|
}
|
||||||
LOG_NOPREFIX << "\n";
|
LOG_NOPREFIX << "\n";
|
||||||
return dst;
|
return dst;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user