[cairo] ARGB, BGRA, RGBA mess

Alexander Larsson alexl at redhat.com
Fri Jan 14 00:45:56 PST 2005


On Thu, 2005-01-13 at 14:41 -0800, Bill Spitzak wrote:
> I also should point out that OpenGL clearly thinks the term "RGBA" means 
> that R is in the byte with the lowest address. This is despite the fact 
> that OpenGL was designed on a big-endian (mips) processor, when it was 
> ported to Intel the designers clearly believed that RGBA meant this.
> 
> It appears that OpenGL supports (in the glDrawPixels call) formats 
> called GL_RGB, GL_RGBA, GL_BGR, GL_BGRA, and GL_ABGR_EXT, though the 
> documentation only describes GL_RGB and GL_RGBA. In all cases the 
> letters indicate the order of the values in memory.
> 
> In addition having "RGBA" describe anything other than the order of 
> bytes in memory is pretty useless if you want to describe data larger 
> than bytes, such as 16-bit or float or half (16-bit floats).

So, using this system, how would you describe the memory layout of a
16bpp framebuffer that uses 5 bits for red, 6 for green and 5 for blue?
Say on a graphics card that reads words as little-endian. (I'm not sure,
but I think this is the most common arrangement for all PCs running in
16bpp.)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a notorious arachnophobic grifter haunted by memories of 'Nam. She's a 
bloodthirsty streetsmart barmaid with her own daytime radio talk show. They 
fight crime! 




More information about the cairo mailing list