Subject: Re: is it the same RGBA, though?
From: Paul Rohr (paul@abisource.com)
Date: Wed Apr 25 2001 - 21:00:54 CDT
At 06:18 PM 4/21/01 -0400, Leonard Rosenthol wrote:
>At 12:34 PM 4/20/2001 -0700, Paul Rohr wrote:
>>Thus, at the time I could run the same XP decoder to emit individual pixels,
>>but I needed platform-specific routines to construct the necessary
>>uncompressed buffers to bit-blast to the screen.  Running that kind of
>>process in reverse to get back to a PNG or JPEG sounds even more obnoxious.
>>
>>Is this not a problem any more?  It'd be wonderful to hear that things have
>>been standardized enough that you could hand the exact same uncompressed
>>RGB(A) buffer to drawing routines on most or all of our supported platforms.
>         You are correct that Mac, Windows and Unix/X have slightly 
>different native representations of how the combination of RGBA pixels are 
>stored - but using a single ifdef in a header you have still have 100% XP 
>code.  In fact, this is exactly what ImageMagick does.  Here is the 
>declaration for a "PixelPacket":
>
>typedef struct _PixelPacket
>{
>#if defined(WORDS_BIGENDIAN)
>   Quantum
>     red,
>     green,
>     blue,
>     opacity;
>#else
>#if defined(macintosh)
>   Quantum
>     opacity,
>     red,
>     green,
>     blue;
>#else
>   Quantum
>     blue,
>     green,
>     red,
>     opacity;
>#endif
>#endif
>} PixelPacket;
That sounds promising.  I also have a vague recollection that there were 
platform-specific issues about how the scanlines built up from individual 
packets were constructed.  For example, stuff like:
  - padding the end of the line to align on on some struct boundary
  - whether the scanlines were top-to-bottom or bottom-to-top
Are those not problems any more, either?  If so, that'd be wonderful news.  
Paul
This archive was generated by hypermail 2b25 : Wed Apr 25 2001 - 20:53:16 CDT