[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] ARGB vs. RGBA
- To: pygame-users@xxxxxxxx
- Subject: [pygame] ARGB vs. RGBA
- From: Jakub Piotr CÅapa <jpc@xxxxxxxxxxxxx>
- Date: Fri, 15 Dec 2006 12:07:39 +0100
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Fri, 15 Dec 2006 06:08:00 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding:sender; b=WGhz6q6vsJLfVHSIg0SWayaHdP6KXCZSNaCOU5Mhm91J57mWIAh2qZgsxGxx1vIEHpXoyiN9LlyLr3c1qpuJhMT68aZG5xr+3315tLezbSaYQ7YYXNpY3DyRpwnwByGDN6Ph+3HQ0AUnmFvTLSzC6cc3FPNqMC0YnEZ2QZRrDNA=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- User-agent: Thunderbird 1.5.0.8 (Macintosh/20061025)
I was trying to make some data exported from cairo as a ARGB (literally
in this byte order on my big-endian machine, A beign in the lowest
address) buffer into a PyGame surface but run in to some problems.
The code which creates the bitmasks required by the SDL conversion
routine does some really strange things.
For RGBA it takes the notation as a literal byte order in memory, low
address first and simply swaps the 4 bytes on BE vs. LE.
The ARGB on the other hand assumes GBAR memory layout (low address
first) on both little and big endians.
Is this intentional? Why doesn't the name reflect the actual memory
layout? Cairo had some discussion whether the ARGB should express the
memory address layout or the significance in a 32bit word but this issue
seems disconnected from this case as PyGame is inconsistent even with
itself here.
If this is intentional than are there any other means of creating a
surface without intermediate string. Let's assume that i don't have to
blit often (so that the conversion between the nativ format and ARGB
won't be a problem) but I want to modify the surface from cairo and
update the surface w/o copying it each time.
Thanks you in advance for any suggestions.