Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-23 00:06:50 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-23 00:06:50 +0400
commit81dadaf7bfa0e58ae6447695fca51d61da7b9e82 (patch)
tree1e9baf1a5c639374b325819f2f30a087566759f3 /source/blender/imbuf
parentba4fb6bf43dad0080e4c148ddf9acc9564748af1 (diff)
Fix #35469: image editor smear and soften paint tools not working correct for
float images, was not taking premul/straight convention into account properly.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/rectop.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index 71f81239547..16268b19b1a 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -321,9 +321,11 @@ void IMB_rectblend(ImBuf *dbuf, ImBuf *obuf, ImBuf *sbuf, unsigned short *dmask,
drf = drectf;
srf = srectf;
for (x = width; x > 0; x--, drf += 4, srf += 4) {
- drf[0] = srf[0];
- drf[1] = srf[1];
- drf[2] = srf[2];
+ float map_alpha = (srf[3] == 0.0f)? drf[3] : drf[3] / srf[3];
+
+ drf[0] = srf[0] * map_alpha;
+ drf[1] = srf[1] * map_alpha;
+ drf[2] = srf[2] * map_alpha;
}
drectf += destskip * 4;
srectf += srcskip * 4;