This site is no longer active and is available for archival purposes only. Registration and login is disabled.

RBG stuff


RBG stuff

Postby Lewil » Feb 28, 2002 @ 4:59pm

Lewil
 


Postby Dan East » Feb 28, 2002 @ 5:30pm

That's correct. Most Pocket PCs use RGB 565 encoding, which assigns the bits to the individual color elements in just that way (RRRRR GGGGGG BBBBB). On most computing hardware data must at least be evenly aligned. Thus you would store an RGB color value in either 32 bits / 4 bytes (even if only 24 of the bits are actually used), or 16 bits / 2 bytes (I'm ignoring palettized, grayscale, etc). Obviously 16 is not evenly divisible by 3, so either one color element gets twice the precision as the others, or you ignore one bit completly. The latter is what is done with RGB 555 encoding. I don't know of any Pocket PCs that use RGB 555.

So Yes, you have to go through an algorithm similar to what you posted to convert RGB 24 to RGB 565, and yes, information is lost in the conversion, and yes, green has twice the precision as red and blue in RGB 565.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


huhu

Postby Lewil » Mar 1, 2002 @ 11:11am

Thanks for lesson :)
i hope this will be usefull...
Lewil
 


Return to Phantom's Forum


Sort


Forum Description

Discuss any of Phantom's projects here (Operation Nutcracker, etc.)

Moderators:

sponge, RICoder, Phantom

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron