5 ms·
Well, it's easier to read in a hex editor and seemed like the right thing to do for a "wire format". The only places where it matters is the header's width/hei
by phoboslab 5y ago
Well, it's easier to read in a hex editor and seemed like the right thing to do for a "wire format".
The only places where it matters is the header's width/height and order of RGB(A) data. Storing RGBA as ABGR is not a great choice, imho. If you want to be endian independent, you have to read one byte at a time anyway (or swap).
- mgaunard 5y agowhy are channels interleaved at all if speed of decompression was the goal?
- user-the-name 5y agoBecause almost everywhere you would use data will expect it as interleaved. Separating the channels would require a second pass to re-interleave the data.
- wheybags 5y agoStoring rgba as abgr is a terrible choice, but are you sure they're actually doing that?
- phoboslab 5y agoSorry, I see how my previous comment was misleading. To clarify: No, QOI is not doing that. QOI stores RGBA as R,G,B,A because it is big endian. Little endian would imply that RGBA is stored as A,B,G,R. Which was my argument against using LE for a file format.
- Taywee 5y agoI don't believe it would imply that, because those are independent elements. RGBA would still be stored as R, G, B, A unless you're considering each pixel as a single 32-bit integer. A C structure for the colors would even live in memory in the order you expect. Just like a string is still stored byte-by-byte even in little-endian contexts. LE vs BE would only affect multi-byte integers and floats, not arrays or structures of single-byte elements.
- jandrese 5y agoARGB would be nice if you want to integrate with Cairo.