diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-10-06 15:21:09 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-10-06 15:21:09 +0200 |
commit | 10e0187df1aa78c7259e8758dcea39d3886c1321 (patch) | |
tree | 9c89bf3f77075133793bb30adf44c2097ac57c97 /gst/coloreffects | |
parent | fa2a4af5bb3fd3c7874c9ed598e215348e6f0035 (diff) |
chromahold: Make everything greyscale if the target color is grey
Diffstat (limited to 'gst/coloreffects')
-rw-r--r-- | gst/coloreffects/gstchromahold.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/coloreffects/gstchromahold.c b/gst/coloreffects/gstchromahold.c index 2c4b2ff0f..d2770e855 100644 --- a/gst/coloreffects/gstchromahold.c +++ b/gst/coloreffects/gstchromahold.c @@ -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; |