|
发表于 2006-5-21 02:16:56
|
显示全部楼层
这是区域画图吧,我的透明度转换(RGBA):
[code:1]
inline e_rgb_color& mix(euint8 r, euint8 g, euint8 b, euint8 a)
{
if(a == 255)
{
red = r; green = g; blue = b;
}
else if(a != 0)
{
euint32 _r = min_c(255, ((euint32)red * (255 - (euint32)a) + (euint32)r * (euint32)a) / 255);
euint32 _g = min_c(255, ((euint32)green * (255 - (euint32)a) + (euint32)g * (euint32)a) / 255);
euint32 _b = min_c(255, ((euint32)blue * (255 - (euint32)a) + (euint32)b * (euint32)a) / 255);
red = (euint8)_r; green = (euint8)_g; blue = (euint8)_b;
}
return *this;
}
[/code:1]
解释(RGB):
目标对应颜色分量=本身对应颜色分量X(1-目标透明度)+绘图对应颜色分量X目标透明度 |
|