[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33374] trunk/blender/source/blender/ blenkernel/intern/colortools.c: Fix [#24964] HISTOGRAM: Inconsistency in spaces

Matt Ebb matt at mke3.net
Mon Nov 29 08:37:21 CET 2010


Revision: 33374
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33374
Author:   broken
Date:     2010-11-29 08:37:20 +0100 (Mon, 29 Nov 2010)

Log Message:
-----------
Fix [#24964] HISTOGRAM: Inconsistency in spaces

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/colortools.c

Modified: trunk/blender/source/blender/blenkernel/intern/colortools.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/colortools.c	2010-11-29 07:07:08 UTC (rev 33373)
+++ trunk/blender/source/blender/blenkernel/intern/colortools.c	2010-11-29 07:37:20 UTC (rev 33374)
@@ -956,13 +956,11 @@
 
 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;
 }
 





More information about the Bf-blender-cvs mailing list