Programming & Tools/TMS320DM368

[DM368] RGB888 to RGB565

다크쌍피 2012. 5. 31. 19:08

RGB888 to RGB565 Define


#define _MODE_555_RGB16BIT(r,g,b) ((b%32) + ((g%32) << 5) + ((r%32) << 10)) //convert 24->16bits
#define _MODE_565_RGB16BIT(r,g,b) ((b%32) + ((g%64) << 6) + ((r%32) << 11)) //convert 24->16bits
#define _RGB16BIT(r,g,b) ((b%32) + ((g%32) << 5) + ((r%32) << 10)) //builds 16bit color