|
|
发表于 2005-11-29 09:38:00
|
显示全部楼层
Re:请教不同色深的位图之间的转换算法!
/*!
***********************************************
\brief
16bits色555格式转换
***********************************************
*/
inline s32 rgb16_555(Byte r, Byte g, Byte b)
{
return (b % 32) + ((g % 32) << 5) + ((r % 32) << 10);
}
/*!
***********************************************
\brief
16bits色565格式转换
***********************************************
*/
inline s32 rgb16_565(Byte r, Byte g, Byte b)
{
return (b % 32) + ((g % 64) << 6) + ((r % 32) << 11);
}
/*!
***********************************************
\brief
32bits色格式转换
***********************************************
*/
inline argb32(Byte a, Byte r, Byte g, Byte b)
{
return b + (g << 8) + (r << 16) + (a << 24);
}
|
|