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:
authorJeroen Bakker <jeroen@blender.org>2020-10-19 12:29:47 +0300
committerJeroen Bakker <jeroen@blender.org>2020-10-19 12:29:47 +0300
commit850944e6cda763f099652bf97d52d22f1deb5daa (patch)
tree10ace4d9f2c2948fad6754ab9cbfc408d6973f7f /source/blender/imbuf
parentf52f51aef2126e599e6d0bd5f234ec912e5fb394 (diff)
Image: Export emissive colors in 3 channel PNG images
Related to T81199. When saving a rendered image with transparency (RGBA) to a 3 channel PNG image the emissive colors were not exported. This change adds the emissive colors to the written file. NOTE: this does not fix the limitation of writing emissive colors to a 4 channel PNG file as the file format does not support this.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/imageprocess.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index 6ad69e72b4f..f8029c08bad 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -458,17 +458,8 @@ void IMB_alpha_under_color_float(float *rect_float, int x, int y, float backcol[
float *fp = rect_float;
while (a--) {
- if (fp[3] == 0.0f) {
- copy_v3_v3(fp, backcol);
- }
- else {
- float mul = 1.0f - fp[3];
-
- fp[0] += mul * backcol[0];
- fp[1] += mul * backcol[1];
- fp[2] += mul * backcol[2];
- }
-
+ const float mul = 1.0f - fp[3];
+ madd_v3_v3fl(fp, backcol, mul);
fp[3] = 1.0f;
fp += 4;