Index:
[thread]
[date]
[subject]
[author]
From: Marcus Sundberg <e94_msu@elixir.e.kth.se>
To : ggi-develop@eskimo.com
Date: Sun, 09 Aug 1998 16:12:18 +0200
Re: LibGGI & 24/32 bit modes
> 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 ?
Sure, every mode should be described in the most simple way that still
is correct.
> 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).
Well, that will depend on the endianness.
When reading/writing multiple pixels at a time we should put 4 bytes
at a time (8 an 64-bit machines), and the order we put the bytes in
when writing a single pixel must be the same as it is when putting
multiple ones.
//Marcus
Index:
[thread]
[date]
[subject]
[author]