Commit f10f565b authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Add clipping function of float between [0,1]

parent 57d4e59f
......@@ -54,7 +54,7 @@ Created on: Apr 28, 2011
#define CLIP_UCHAR(x) (uchar)((x) < 0 ? 0 : ((x) >= 256 ? 255 : (x)))
/// Clip the value on the number between 0 and 255. Usefull to convert any number to a uchar.
#define BLC_CLIP_FLOAT(x) ((x) < 0 ? 0.f : ((x) >= 1.0f ? 1.0f : (x)))
#define BLC_CLIP_FLOAT(x) ((x) < 0 ? 0.f : ((x) > 1.0f ? 1.0f : (x)))
/**Shorcut to do a loop from 0 to max-1 element. If it is not broken, the last iterator after the loop is max.
You should not modify the iterator yourself, in this case use a standard for(;;) */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment