diff options
author | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-09 12:16:46 +0000 |
---|---|---|
committer | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-09 12:16:46 +0000 |
commit | 85d5e43cd4856dd3d14fefd450a0606666b6dc80 (patch) | |
tree | e8e6e2a09b0a1a2cc2177eeb258bbe70e9406a97 /Plugins/plugin.h | |
parent | 126a4a6c255e2ab9836899717e9c21ee319d4c13 (diff) |
added PixelPack002
svn path=/trunk/Framestein/; revision=29
Diffstat (limited to 'Plugins/plugin.h')
-rw-r--r-- | Plugins/plugin.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Plugins/plugin.h b/Plugins/plugin.h index 00d3514..00281e5 100644 --- a/Plugins/plugin.h +++ b/Plugins/plugin.h @@ -116,4 +116,21 @@ __inline pixel32 rgbtocolor32(byte r, byte g, byte b) return (b << 16) | (g << 8) | r; } +// restrict input to be 0..255 <olaf.matthes@gmx.de> +__inline byte klamp255(long in) +{ + byte out = in<0 ? 0 : in; + out = 255<out ? 255 : out; + return(out); +} + +// restrict input to be 16..235 as it is usual with signals +// conforming to ITU-R 601 <olaf.matthes@gmx.de> +__inline byte klamp601(long in) +{ + byte out = in<16 ? 16 : in; + out = 235<out ? 235 : out; + return(out); +} + #endif // #ifndef _PLUGINH |