diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-27 16:51:23 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-27 16:51:23 +0400 |
commit | 8f9150871c5f41df948d523c51ed04fc689eaf07 (patch) | |
tree | 4b55ddd5dee285d7c6f9fa56be6a15e2a3eea007 /source/blender/blenlib/BLI_math_color.h | |
parent | a5806778012e3baee8ac2ba48c8dbed8b57f3947 (diff) |
Fix part of #34233: bad alpha blending for 2D image painting. This is a very
old issue, the formulas here were never quite right, should all work ok now
with byte and float images.
Some differences:
* Colors with zero alpha from the background will never have an influence, so
you don't get alpha fringes when painting over such areas. This does give
hard edges when looking at the RGB channels alone, but there's no way to
avoid that and fringes at the same time, same behavior as other painting apps.
* Add/Subtract/Multiply/Lighten/Darken now leave the alpha channel unchanged
and work only the RGB channels, again same behavior as many other apps.
* Erase/Add alpha now compensates for premultiplied float images to keep the
straight RGB colors the same.
Next: fix projection painting.
Diffstat (limited to 'source/blender/blenlib/BLI_math_color.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_color.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index 145427ea529..6f432761a55 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -126,7 +126,7 @@ void xyz_to_lab(float x, float y, float z, float *l, float *a, float *b); MINLINE int compare_rgb_uchar(const unsigned char a[3], const unsigned char b[3], const int limit); -/***************** lift/gamma/gain / ASC-CDL conversion *****************/ +/********* lift/gamma/gain / ASC-CDL conversion ***********/ void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power); |