提交 8e1dc361 authored 作者: Seven Du's avatar Seven Du 提交者: Michael Jerris

FS-7550 quick and dirty tweak for overlay, maybe need furthur tweaks but this…

FS-7550 quick and dirty tweak for overlay, maybe need furthur tweaks but this should work with most transparent pngs
上级 81ef7703
......@@ -480,9 +480,15 @@ SWITCH_DECLARE(void) switch_img_overlay(switch_image_t *IMG, switch_image_t *img
switch_img_get_rgb_pixel(IMG, &RGB, x + j, i);
switch_img_get_rgb_pixel(img, &rgb, j + xoff, i - y + yoff);
if (rgb.a > 0) {
c.r = ((RGB.r * (255 - alpha)) >> 8) + ((rgb.r * alpha) >> 8);
c.g = ((RGB.g * (255 - alpha)) >> 8) + ((rgb.g * alpha) >> 8);
c.b = ((RGB.b * (255 - alpha)) >> 8) + ((rgb.b * alpha) >> 8);
} else {
c.r = RGB.r;
c.g = RGB.g;
c.b = RGB.b;
}
switch_img_draw_pixel(IMG, x + j, i, &c);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论