mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-20 04:28:13 +02:00
gl-renderer: move alpha pre-mult from YUV to RGB
Mathematically the result is the same, while multiplying RGB with alpha is easier to understand as correct than the earlier form. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
a8d5ef4a04
commit
054ba37084
1 changed files with 2 additions and 3 deletions
|
|
@ -57,12 +57,11 @@ yuva2rgba(float y, float u, float v, float a)
|
|||
{
|
||||
vec4 color_out;
|
||||
|
||||
y *= a;
|
||||
u *= a;
|
||||
v *= a;
|
||||
color_out.r = y + 1.59602678 * v;
|
||||
color_out.g = y - 0.39176229 * u - 0.81296764 * v;
|
||||
color_out.b = y + 2.01723214 * u;
|
||||
|
||||
color_out.rgb *= a;
|
||||
color_out.a = a;
|
||||
|
||||
return color_out;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue