Page 1 of 1

565 and 555 screen formats

PostPosted: Mar 17, 2002 @ 6:09pm
by werner
Hi all,

Are there any known devices that use 555 as their 16-bit buffer format? It seems like all the current devices (iPaq, Jornada, etc.) use 565 as their screen buffer format. I know GAPI will return it as a possible format (KfDirect555) but I don't know of any devices that use it.

Also, does anyone have a list of the GAPI results for a bunch of different devices. Does anyone support the kfDirect444 format or kfDirect888 yet?

Thanks for the info!

Werner Sharp

555

PostPosted: Mar 17, 2002 @ 9:37pm
by Johan
Hi Werner,

Currently no devices use the 555 format. But new devices are coming along all the time (including the new smart phones), so it would be wise to be prepared for it.

One solution (if you are using C++) is to use the adapter design pattern to support multiple pixel formats for 16-bit devices:

Allocate space for the screen as a WORD* pointer. Create a template class with a member variable of type T. The T member variable contains inline functions for native pixel <-> RGB color conversions. Then instanciate two objects of the template class, one with a 555 member object, and one with a 565 member object. Put all operations to access the 16-bit surface in the template class as inline operations.

I use this in a GapiDraw which will be announced later tonight. It uses this design pattern to access screen pixels, and can be adapted to support any screen format, with any screen depth, with no loss of performance (since everything becomes inlined code). Adding support for other formats is as easy as adding a new native format <-> RGB color conversion class and a new adapter template class instance.

Best regards,
Johan