mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
videomixer: Fix background blitting when a color mode is selected with BGRA
This commit is contained in:
parent
83fc39ccff
commit
a5c30ae502
1 changed files with 8 additions and 7 deletions
|
@ -111,17 +111,18 @@ gst_videomixer_fill_bgra_color (guint8 * dest, gint width, gint height,
|
|||
gint red, green, blue;
|
||||
gint i, j;
|
||||
|
||||
red = 1.164 * (colY - 16) + 1.596 * (colV - 128);
|
||||
green = 1.164 * (colY - 16) - 0.813 * (colV - 128) - 0.391 * (colU - 128);
|
||||
blue = 1.164 * (colY - 16) + 2.018 * (colU - 128);
|
||||
|
||||
red = CLAMP (1.164 * (colY - 16) + 1.596 * (colV - 128), 0, 255);
|
||||
green =
|
||||
CLAMP (1.164 * (colY - 16) - 0.813 * (colV - 128) - 0.391 * (colU - 128),
|
||||
0, 255);
|
||||
blue = CLAMP (1.164 * (colY - 16) + 2.018 * (colU - 128), 0, 255);
|
||||
|
||||
for (i = 0; i < height; i++) {
|
||||
for (j = 0; j < width; j++) {
|
||||
*dest++ = blue;
|
||||
*dest++ = green;
|
||||
*dest++ = red;
|
||||
*dest++ = 0xff;
|
||||
*dest++ = colY;
|
||||
*dest++ = colU;
|
||||
*dest++ = colV;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue