Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
blaar
blibs
blc_core
Commits
f10f565b
Commit
f10f565b
authored
Feb 08, 2017
by
Arnaud Blanchard
Browse files
Add clipping function of float between [0,1]
parent
57d4e59f
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/blc_tools.h
View file @
f10f565b
...
...
@@ -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(;;) */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment