diff options
author | Matt Ebb <matt@mke3.net> | 2010-11-29 10:37:20 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-11-29 10:37:20 +0300 |
commit | 04d374194756516c8b7a15fff99bfa72a2239f75 (patch) | |
tree | 6f5dd3dcd19c5516c3c77fefd1a620c6a2c0d7dc /source/blender/blenkernel/intern/colortools.c | |
parent | 5fe2a16385ca343c6230a87e39e38055da1caa39 (diff) |
Fix [#24964] HISTOGRAM: Inconsistency in spaces
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 86d7cbf0133..1be1b9b9ad0 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -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; } |