Index: [thread] [date] [subject] [author]
  From: Andrew Apted <ajapted@netspace.net.au>
  To  : ggi-develop@eskimo.com
  Date: Sun, 9 Aug 1998 14:19:37 +1000

LibGGI & 24/32 bit modes

Just a couple of queries about the new pixel-format scheme:

1) 32 bit modes -- the set of masks describe the layout perfectly,
   without any funniness like you get with reverse-endian 16 bit modes,
   so shouldn't we avoid using the GGI_PF_REVERSE_ENDIAN flag here ?
   
   For example, if the normal masks are:
      red = 0x00ff0000  green = 0x0000ff00  blue = 0x000000ff

   then the reverse endian version would be:
      red = 0x0000ff00  green = 0x00ff0000  blue = 0xff000000

   and hence no need to bother with GGI_PF_REVERSE_ENDIAN.

2) 24 bit modes have to be read / written 1 byte at a time, but in
   what order ?  There are two possibilities:

      buf[0] = (ggi_pixel & 0xff0000) >> 16;
      buf[1] = (ggi_pixel & 0xff00) >> 8;
      buf[2] = (ggi_pixel & 0xff)

      versus

      buf[0] = (ggi_pixel & 0xff)
      buf[1] = (ggi_pixel & 0xff00) >> 8;
      buf[2] = (ggi_pixel & 0xff0000) >> 16;

   We should pick one and stick to it.  I think the second version looks
   easier to optimize (e.g. *buf++ = (uint8) pix; pix >>= 8).

Cheers,
_____________________________________________  ____
                                               \  /
  Andrew Apted   <andrew@ggi-project.org>       \/
  

Index: [thread] [date] [subject] [author]