[cairo] byte data storage format

Gerdus van Zyl gerdusvanzyl at gmail.com
Wed Feb 11 00:14:02 PST 2009


It's in BGRA format. I think it's platform and not architecture
specific since windows at least works with BGR. And the reason for
that is I guess performance.

~G

On Wed, Feb 11, 2009 at 1:03 AM, Dan Ventura <dventura7 at gmail.com> wrote:
> Hello,
> If I set my R, G, B, A values to 0.25, 0.5, 0.75 and 1.0 respectively and
> then cairo_paint() a surface, I get a nice mostly blue color output, just as
> I would expect.
> However, if I then grab the data from that surface using
> cairo_image_surface_get_data() and look at the first four bytes, I see
> (after normalizing) 0.75, 0.5, 0.25, 1.0.
> I thought I read somewhere in the documentation that the data were stored in
> native-endian format, and I thought that intel processors (I'm using a
> macbook pro) were little endian.  In any case, this doesn't look little or
> big endian.  What gives?
>
> Thanks,
> Dan
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>


More information about the cairo mailing list