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

Add macro to convert a float between [0.5/256, 1-0.5/256] in uchar and reciprocaly.

parent dca486dd
......@@ -219,6 +219,13 @@ MANY_REALLOCATIONS(&values, 7);
//Usefull for casting user_data in callback
#define USER_DATA( type, variable, pointer) type variable=(type)pointer
///x is in [0.5f/256, 1-0.5f/256]
#define BLC_NORMED_FLOAT_TO_UCHAR(x) (x*256-0.5f)
///
#define BLC_UCHAR_TO_NORMED_FLOAT(x) ((x+0.5f)/256);
// If it has been initialise it points toward argv[0]. Useful to debug different program in parallel.
extern char const *blc_program_name;
......
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