mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
chromahold: Make everything greyscale if the target color is grey
This commit is contained in:
parent
fa2a4af5bb
commit
10e0187df1
1 changed files with 2 additions and 2 deletions
|
@ -308,7 +308,7 @@ rgb_to_hue (gint r, gint g, gint b)
|
|||
C = M - m;
|
||||
|
||||
if (C == 0) {
|
||||
h = 0;
|
||||
return G_MAXUINT;
|
||||
} else if (M == r) {
|
||||
h = ((g - b) / C) % 6;
|
||||
} else if (M == g) {
|
||||
|
@ -370,7 +370,7 @@ gst_chroma_hold_process_xrgb (guint8 * dest, gint width,
|
|||
|
||||
h2 = rgb_to_hue (r, g, b);
|
||||
diff = hue_dist (h1, h2);
|
||||
if (diff > tolerance) {
|
||||
if (h1 == G_MAXUINT || diff > tolerance) {
|
||||
grey = (13938 * r + 46869 * g + 4730 * b) >> 16;
|
||||
grey = CLAMP (grey, 0, 255);
|
||||
dest[p[1]] = grey;
|
||||
|
|
Loading…
Reference in a new issue