Closed g40 closed 6 months ago
Each pixel is a 32-bit quantity, with alpha in the upper 8 bits, then red, then green, then blue. The 32-bit quantities are stored native-endian. Pre-multiplied alpha is used. (That is, 50 transparent red is 0x80800000, not 0x80ff0000.). In short Bitmap format is BGRA(Pre-multiplied) in little endian machine and ARGB(Pre-multiplied) in big endian machine.
Can we clarify natural colour order please?
Following on from https://github.com/sammycage/lunasvg/issues/144:
lunasvg.h
has this comment:* @note Bitmap format is ARGB32 Premultiplied.
There is also a convert function which rewrites the bitmap colour ordering according to the function arguments:
void convertToRGBA() { convert(0, 1, 2, 3, true); }
which definitely works but
convert()
has the code below which indicates the internal pixel arrangement is BGRA?Or (entirely likely) have I missed something?
as does
clear()
(https://github.com/sammycage/lunasvg/blob/master/source/lunasvg.cpp#L80)