[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11919] trunk/blender/source/blender/imbuf /intern/divers.c: Bugfix #7125

Ton Roosendaal ton at blender.org
Sun Sep 2 18:34:02 CEST 2007


Revision: 11919
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11919
Author:   ton
Date:     2007-09-02 18:34:02 +0200 (Sun, 02 Sep 2007)

Log Message:
-----------
Bugfix #7125

The conversion from float to char (byte) was not correct. It should include
the possibility for colors like 0.999999 to become 255 still. The correct
multiplication factor I don't know though... and this should become a system
wide definition!

Modified Paths:
--------------
    trunk/blender/source/blender/imbuf/intern/divers.c

Modified: trunk/blender/source/blender/imbuf/intern/divers.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/divers.c	2007-09-02 15:55:43 UTC (rev 11918)
+++ trunk/blender/source/blender/imbuf/intern/divers.c	2007-09-02 16:34:02 UTC (rev 11919)
@@ -174,7 +174,7 @@
 	}
 }
 
-#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val))
+#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.99f*val))
 
 void IMB_rect_from_float(struct ImBuf *ibuf)
 {





More information about the Bf-blender-cvs mailing list