[cairo] ARGB, BGRA, RGBA mess (was: Radial gradiant bug?)

Carl Worth cworth at cworth.org
Thu Jan 13 11:33:41 PST 2005


On Thu, 13 Jan 2005 11:14:59 -0500, Chris wrote:
> Not a big deal.  The issue I was frustrated with is that some things are
> rendered using the pixman library and formatting while in other places
> (gradients) the Cairo image surface was doing the rendering.

The internal architecture could certainly use some cleaning up in
spots. The split here comes from some parts being designed bottom-up,
(eg. capabilities of the RENDER extension designed to fit well with
hardware), and others top-down, (gradients are a nice object that many
users want to draw).

> Yes, this makes sense on one hand.  On the other hand, and maybe it's
> because I'm used to using other imaging libraries, if I'm rendering to
> an image buffer I would normally expect a certain platform independent
> byte ordering (like PNG, TGA, Jpeg, bitmaps, etc.).  Or at least the
> ability to specify such things.

I think with file formats you get into a different set of issues than
with in-memory images. Obviously, with file formats it's important to
have platform independent byte-ordering.

And I've wondered if it would make sense to add any image loading
convenience functions to cairo, (we are already allowing the library
to link against libpng after all). But the difficulty of deciding
which images to support might argue for leaving this out completely. I
don't know.

> I don't think it's a bug in Cairo, it is just unexpected from my view.
> In my world I'm used to having an particular format that always has the
> same byte ordering no matter what platform it is used on.  So if it says
> "ARGB" then I expect the bytes in memory to be A, R, G, B on all the
> platforms.  This is just my view from working with bitmaps, targa's,
> jpeg's, etc.

The one thing I would like to know is if there's a more "standard" way
to name the formats. It would be helpful if it were more obvious when
we are talking about ARGB as the order of significant bytes within a
word, vs. ARGB as the order of addressable bytes. I'm open to good
suggestions here.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050113/51f74930/attachment.pgp


More information about the cairo mailing list