hi there ! this is for a good understanding of all that concern the video buffer...
if you set a pixel to a value, this value must be an unsigned short = 16 bits
if you want to set it from a RGB value of 8 bits by channel you get 3x8 = 24 bits
i suppose all the stuff is to reduce from 24 to 16, to do so, we often find this code:
what i just realised is that we take only 5 higher bits of red and blue but 6 of green !!!
do this mean that the PPC pixel structure is:
5 bits of red, 6 bits of green, 5 of blue ???
or is there a more "rationnal" (slower
) way to get a better pix definition by 24bits rvb ???
thanks all
if you set a pixel to a value, this value must be an unsigned short = 16 bits
if you want to set it from a RGB value of 8 bits by channel you get 3x8 = 24 bits
i suppose all the stuff is to reduce from 24 to 16, to do so, we often find this code:
- Code:
#define rgb(r,g,b) ((((r)>>3)<<11)|(((g)>>2)<<5)|((b)>>3))
what i just realised is that we take only 5 higher bits of red and blue but 6 of green !!!
do this mean that the PPC pixel structure is:
5 bits of red, 6 bits of green, 5 of blue ???
or is there a more "rationnal" (slower
thanks all