DirectFB - Home of the pragmatist Roadmap

[directfb-users] Re: Range of colours with 16bpp and 8bpp
Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[directfb-users] Re: Range of colours with 16bpp and 8bpp

Quoting Otto Wyss:
> Does anyone know what colour ranges for 16bpp and 8bpp are possible.
> Since I'm currently not able to reduce the resolution I can't find it
> out myself. 32bpp and 24bpp seems to run fine with 265 values per RGB.

RGB16 (565)  has 32 levels of red and blue, but 64 levels of green
RGB15 (555)  has 32 levels of red, green and blue
RGB332       has 8 levels of red and green, but 4 levels of blue

If you simply shift the values of each channel you will get

r = 248
g = 252
b = 248

after conversion from 565 to 888.

I think the best way is to create a lookup table for 5 to 8 bit and
one for 6 to 8 bit using correct values, i.e. 0x1f -> 0xff.

The software driver only uses such lookup tables for RGB332 so far.

/* lookup tables for 2/3bit to 8bit color conversion */
static const __u8 lookup3to8[] = { 0x00, 0x24, 0x49, 0x6d, 0x92, 0xb6, 0xdb, 0xff};
static const __u8 lookup2to8[] = { 0x00, 0x55, 0xaa, 0xff};

Best regards,
  Denis Oliver Kropp

| DirectFB - Hardware accelerated graphics |
|                 |

                            Convergence GmbH

Home | Main Index | Thread Index / Development / Old Archives