diff options
author | Ton Roosendaal <ton@blender.org> | 2007-09-02 20:34:02 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2007-09-02 20:34:02 +0400 |
commit | 22c23fb04f7f1297b971f03d69b8b04b7dd9caa4 (patch) | |
tree | 7ff95d8e9ce04280f22d55a611c5acf1630457bc /source/blender/imbuf/intern/divers.c | |
parent | 0caf8e477f2b4725f4b0213bf71d88b862fb1aa6 (diff) |
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!
Diffstat (limited to 'source/blender/imbuf/intern/divers.c')
-rw-r--r-- | source/blender/imbuf/intern/divers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index a4fab4a3572..8db07f581f5 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -174,7 +174,7 @@ void IMB_gamwarp(struct ImBuf *ibuf, double gamma) } } -#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) { |