I'm reading about how to build up a 16-bit high color mode.
This is supposed to be done by "simple bit shifting and masking operations", but I just don't get it.![]()
Concider the following macros:
What is really going on in these macros?Code:// This builds a 16 bit color value in 5.5.5 format (1-bit alpha mode) #define _RGB16BIT555(r,g,b) ((b%32) + ((g%32) << 5) + ((r%32) << 10)) // This builds a 16 bit color value in 5.6.5 format (Green dominate mode) #define _RGB16BIT565(r,g,b) ((b%32) + ((g%64) << 6) + ((r%32) << 11))![]()



LinkBack URL
About LinkBacks



