[cairo] Confused by render to image buffer

Chris fltk at functionalfuture.com
Fri Dec 24 18:11:03 PST 2004


On Fri, 2004-12-24 at 17:07 -0800, Ned Konz wrote: 
> What do you mean? I believe that it's in RGBA (or ARGB, I forget which) form 
> already.
> 
> Is it possible that this is an endianness issue and that the byte ordering 
> within a 32-bit word isn't predictable across platforms? I sure hope not, as 
> I'm counting on it to be the same.
> 
> What hardware platform are you using?

There may be endian issues but I'm getting bizarre results.

For example, on x86 Linux, rendering to an image buffer produces values
in BGRA order at the byte level.  However, on PPC MacOS X it comes out
in ABGR order.

So the BGR is consistent but the alpha value is completely reversed on
each platform.

That's not good, but maybe there is a purpose to all this?

Most graphics API's and image formats won't accept either of those
formats unless they have specific support for such things.  They almost
always want things in R,G,B,A order at the byte level.  I would think
that it should at least be consistent within pixman.

-- 
// Chris




More information about the cairo mailing list