diff options
author | Luis de Bethencourt <luis@debethencourt.com> | 2012-05-17 09:45:52 +0100 |
---|---|---|
committer | Luis de Bethencourt <luis@debethencourt.com> | 2012-05-17 10:54:31 +0100 |
commit | 4990dc2d1fb9e57efb19d003136d0fbfb63f945d (patch) | |
tree | a6d1aa70b8539e1478ee15d470b917fa321114f4 /gst/gaudieffects | |
parent | cb3d1794f812fd16eff90e873118d72f056b7c96 (diff) | |
download | gstreamer-plugins-bad-4990dc2d1fb9e57efb19d003136d0fbfb63f945d.tar.gz |
gaudieffects: use CLAMP in dodge
No need to have a gate_int () function duplicating the already existing and
established CLAMP () function.
Diffstat (limited to 'gst/gaudieffects')
-rw-r--r-- | gst/gaudieffects/gstdodge.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/gst/gaudieffects/gstdodge.c b/gst/gaudieffects/gstdodge.c index 062ea6809..14ef7c446 100644 --- a/gst/gaudieffects/gstdodge.c +++ b/gst/gaudieffects/gstdodge.c @@ -93,7 +93,6 @@ enum /* Initializations */ -static gint gate_int (gint value, gint min, gint max); static void transform (guint32 * src, guint32 * dest, gint video_area); /* The capabilities of the inputs and outputs. */ @@ -256,25 +255,12 @@ gst_dodge_plugin_init (GstPlugin * dodge) /*** Now the image processing work.... ***/ -/* Keep the values inbounds. */ -static gint -gate_int (gint value, gint min, gint max) -{ - if (value < min) { - return min; - } else if (value > max) { - return max; - } else { - return value; - } -} - /* Transform processes each frame. */ static void transform (guint32 * src, guint32 * dest, gint video_area) { - guint32 in, red, green, blue; - gint x; + guint32 in; + gint x, red, green, blue; for (x = 0; x < video_area; x++) { in = *src++; @@ -287,9 +273,9 @@ transform (guint32 * src, guint32 * dest, gint video_area) green = (256 * green) / (256 - green); blue = (256 * blue) / (256 - blue); - red = gate_int (red, 0, 255); - green = gate_int (green, 0, 255); - blue = gate_int (blue, 0, 255); + red = CLAMP (red, 0, 255); + green = CLAMP (green, 0, 255); + blue = CLAMP (blue, 0, 255); *dest++ = (red << 16) | (green << 8) | blue; } |