[maemo-developers] [maemo-developers] Nokia SDL color format for pixels

From: Eero Tamminen eero.tamminen at nokia.com
Date: Thu Aug 28 17:07:02 EEST 2008
Hi,

ext Michael Stepanov wrote:
> On Tue, Apr 15, 2008 at 3:50 PM, Frantisek Dufka <dufkaf at seznam.cz> wrote:
>>> So, how in that situation I can get correct color?
>>>
>> It is already correct. The color format is RGB565. What 'correct' means to
>> you in this context? If you need the value in different format you need to
>> convert it.
>>
>>
> Yes, I need to convert RGB565 to RGB888 to compare two values - actual pixel
> color and pink color. Could you suggest me, please, some way to do that?

SDL_Surface pixel format structure contains the necessary shift & mask
values already for this conversion and SDL documentation has an example
on how to use them.

SDL automatically does the conversion in the other direction (e.g.) 
RGB888 -> display format, but for performance reasons it's usually best
to do that conversion when loading images etc.  (SDL offers a separate
function for this conversion)


	- Eero

More information about the maemo-developers mailing list