Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-11-29 10:37:20 +0300
committerMatt Ebb <matt@mke3.net>2010-11-29 10:37:20 +0300
commit04d374194756516c8b7a15fff99bfa72a2239f75 (patch)
tree6f5dd3dcd19c5516c3c77fefd1a620c6a2c0d7dc /source/blender/blenkernel/intern/colortools.c
parent5fe2a16385ca343c6230a87e39e38055da1caa39 (diff)
Fix [#24964] HISTOGRAM: Inconsistency in spaces
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r--source/blender/blenkernel/intern/colortools.c6
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;
}