convert to float the input of RGBTOGRAY macro, or it can cause rounding errors in byte vectors.
This commit is contained in:
parent
d539f09864
commit
73c5be6f5f
|
|
@ -77,7 +77,7 @@ extern const vec3_t g_vec3_axis_z;
|
||||||
#define FLOAT_SNAP(f,snap) ( (float)( floor( (f) / (snap) + 0.5 ) * (snap) ) )
|
#define FLOAT_SNAP(f,snap) ( (float)( floor( (f) / (snap) + 0.5 ) * (snap) ) )
|
||||||
#define FLOAT_TO_INTEGER(f) ( (float)( floor( (f) + 0.5 ) ) )
|
#define FLOAT_TO_INTEGER(f) ( (float)( floor( (f) + 0.5 ) ) )
|
||||||
|
|
||||||
#define RGBTOGRAY(x) ( (x)[0] * 0.2989f + (x)[1] * 0.5870f + (x)[2] * 0.1140f )
|
#define RGBTOGRAY(x) ( (float)((x)[0]) * 0.2989f + (float)((x)[1]) * 0.5870f + (float)((x)[2]) * 0.1140f )
|
||||||
|
|
||||||
#define Q_rint(in) ((vec_t)floor(in+0.5))
|
#define Q_rint(in) ((vec_t)floor(in+0.5))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user