>>>>> "Steve" == Steve Chaplin <[EMAIL PROTECTED]> writes:
    Steve> This is the official definition from the manual:
    Steve> CAIRO_FORMAT_ARGB32 each pixel is a 32-bit quantity, with
    Steve> alpha in the upper 8 bits, then red, then green, then
    Steve> blue. The 32-bit quantities are stored
    Steve> native-endian. Pre-multiplied alpha is used. (That is, 50%
    Steve> transparent red is 0x80800000, not 0x80ff0000.)

    Steve> What I think this means is: cairo ARGB32 is stored not as 4
    Steve> 8-bit quantities, but as one 32-bit int.  On big-endian
    Steve> systems the byte order is ARGB, as you would expect, but on
    Steve> little-endian systems (like a PC) the byte order is BGRA.

    Steve> I imagine the reason is that its easier/faster to
    Steve> read/write one 32-bit int than it is to read/write four
    Steve> bytes.

OK, I see the source of my confusion.  argb determines the order but
it doesn't determine whether the most significant bit is first or
last....

I added a method buffer_bgra32 to the image backend.  I'm not sure
this is the right way to deal with the endianness bit it's easy and
will probably work.  I'll leave it to you guys to fix the cairo
backend to selectively call the right method and test it across
platforms, or propose a better solution if you don't like this one...

JDH

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to