[vlc-devel] [PATCH] introduce CLIP() macro to replace use pair of __MAX() and __MIN()

Rafaël Carré funman at videolan.org
Tue Nov 15 23:40:47 CET 2011


Le Tue, 15 Nov 2011 21:59:28 +0000,
Rob Jonson <rob at hobbyistsoftware.com> a écrit :

> Isn't CLAMP more common?

"clip" is used in multimedia: http://en.wikipedia.org/wiki/Clipping see
computer graphics and signal processing definitions.

> #define CLAMP(x, low, high)  (((x) > (high)) ? (high) : (((x) < (low))
> ? (low) : (x)))
> 
> from
> http://developer.gnome.org/glib/2.30/glib-Standard-Macros.html#CLAMP:CAPS

Also -100 points for using glib as a reference :p

-- 
Rafaël Carré



More information about the vlc-devel mailing list