diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-10-17 17:34:20 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-10-17 17:34:20 +0400 |
commit | 6ff2110edc64655de93738a5e694c02a56981097 (patch) | |
tree | 03959f568e9150aeab441dbb8c15eea0e8abb977 /source/blender/src | |
parent | bf0440add886761706476b69b5355ec7d94650c2 (diff) |
Fix for imagepaint soften tool giving a bit too dark results,
due to poor float-to-char conversion.
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/imagepaint.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index cc3951f4e90..149dbf1d026 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -95,11 +95,10 @@ /* Defines and Structs */ -#define IMAPAINT_FLOAT_TO_CHAR(f) ((char)(f*255)) #define IMAPAINT_CHAR_TO_FLOAT(c) (c/255.0f) -#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { c[0]=IMAPAINT_FLOAT_TO_CHAR(f[0]); \ - c[1]=IMAPAINT_FLOAT_TO_CHAR(f[1]); c[2]=IMAPAINT_FLOAT_TO_CHAR(f[2]); } +#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { c[0]=FTOCHAR(f[0]); \ + c[1]=FTOCHAR(f[1]); c[2]=FTOCHAR(f[2]); } #define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) { f[0]=IMAPAINT_CHAR_TO_FLOAT(c[0]); \ f[1]=IMAPAINT_CHAR_TO_FLOAT(c[1]); f[2]=IMAPAINT_CHAR_TO_FLOAT(c[2]); } #define IMAPAINT_FLOAT_RGB_COPY(a, b) VECCOPY(a, b) |