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

8bit to 16 bit value


8bit to 16 bit value

Postby R0B » Jan 5, 2002 @ 10:34am

Ok, here is the deal.  I have an 8bit color value stored in a byte.  I need to convert it into a 16 bit color value so it can be displayed on the screen.  I'm not sure of the exact format of the 8 bit value, but my guess would be 3-3-2.  What would you guys recomend I do?
"1011001010 NNNNNNNNNNOOOOOOOOOOOOOOOO!!!!!!" -Bender
User avatar
R0B
got muffins?
 
Posts: 1894
Joined: Jun 22, 2001 @ 12:04pm


Re: 8bit to 16 bit value

Postby MirekCz » Jan 5, 2002 @ 11:03am

isn't it using a palette?<br>if not, simple convert it to 16bpp and try 3-3-2,3-2-3,2-3-3 formats in case you get some problems. It might also be a "brightness" describing value which simple shouldn't be transfered to 16bpp at all. Hard to say without source.
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Re: 8bit to 16 bit value

Postby Dan East » Jan 5, 2002 @ 11:25am

Being your porting an id Software game, I can almost guarantee beyond any doubt that it is a palletized image, as Mirek said. Wolf3D, Quake1 and Quake2 are almost identical in that respect, so Doom would obviously not be radically different. Plus 8 bit RGB would look like total crap.<br>In the display implementation file there should be a SetPalette type function that is passed an array of RGB components which are 24 bit total for each entry. You should convert them to RGB 565 at that time and store them in a global array. When you blit out the display you just look up the bitmap pixel values into that palette array. Look at the PQ source, you should be able to practically copy / paste that over, especially since you modified it for the 720 already.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

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