Fix [#24964] HISTOGRAM: Inconsistency in spaces

This commit is contained in:
Matt Ebb 2010-11-29 07:37:20 +00:00
parent 5fe2a16385
commit 04d3741947

@ -956,13 +956,11 @@ void curvemapping_table_RGBA(CurveMapping *cumap, float **array, int *size)
DO_INLINE int get_bin_float(float f)
{
int bin= (int)(f*255);
int bin= (int)((f*255) + 0.5); /* 0.5 to prevent quantisation differences */
/* note: clamp integer instead of float to avoid problems with NaN */
CLAMP(bin, 0, 255);
//return (int) (((f + 0.25) / 1.5) * 255);
return bin;
}