Hey guys, this is probably a simple question but what is the pixel encoding for 16bpp? I looked it up and found: http://en.wikipedia.org/wiki/BMP_file_format but the 16bpp encoding doesn't seem to work right with my 16bpp VBE mode. So what is the correct encoding? And how would you go about converting a regular RGB value as three bytes into a 16bpp word?
Thanks, Matt
Pixel Format Encoding
-
Octocontrabass
- Member

- Posts: 6301
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Pixel Format Encoding
Don't assume pixel formats.
The typical conversion from a higher depth to 16bpp to is to remove the lowest few bits of each channel and shift them into the correct locations. The VBE functions will tell you how many bits to remove and how far to shift.
(You probably won't see too much variety in real video cards, though: most will be kind of like this.)
The typical conversion from a higher depth to 16bpp to is to remove the lowest few bits of each channel and shift them into the correct locations. The VBE functions will tell you how many bits to remove and how far to shift.
(You probably won't see too much variety in real video cards, though: most will be kind of like this.)
Re: Pixel Format Encoding
Ok thanks Octocontrabass!Octocontrabass wrote:Don't assume pixel formats.
The typical conversion from a higher depth to 16bpp to is to remove the lowest few bits of each channel and shift them into the correct locations. The VBE functions will tell you how many bits to remove and how far to shift.
(You probably won't see too much variety in real video cards, though: most will be kind of like this.)
- Matt
