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:
authorJoseph Eagar <joeedh@gmail.com>2008-02-14 15:19:37 +0300
committerJoseph Eagar <joeedh@gmail.com>2008-02-14 15:19:37 +0300
commit139b612b09616cc1a7558f8f60b05ef6ee97580f (patch)
tree904282ef049f521033c5fefd55de8786d924c48b /source/blender/blenkernel/intern/image.c
parent4339c32c6c3c10f61913ebfce4675aff8b2c4d5b (diff)
The "premul" option for images had a very bad implementation. It
basically flagged the image so that on next load/reload, the image data would be converted to premul. This was very confusing to the user, as it meant premul wouldn't take effect will the image was reloaded, and it would also change the image data, which the user might've been painting. To fix this, I've removed this behaviour and instead made the premul option apply at render time. During render while evaluating an image texture, if the image has the premul flag set then the premul operation is done on the texture result data, thus not touching the image data at all. Also, I've made premul be turned on by default.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 3b7ab4951f6..aeed850c47a 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -276,6 +276,7 @@ static Image *image_alloc(const char *name, short source, short type)
ima->source= source;
ima->type= type;
+ ima->flag = IMA_DO_PREMUL;
}
return ima;
}
@@ -1663,8 +1664,11 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
ima->packedfile = newPackedFile(str);
}
- if(ima->flag & IMA_DO_PREMUL)
- converttopremul(ibuf);
+ /*ok, this is *not* what a user expects when he clicks the premul
+ button, that his image is actually changed. This should be a
+ render-time option, not a modification to the image! - joeedh*/
+ /*if(ima->flag & IMA_DO_PREMUL)
+ converttopremul(ibuf);*/
}
else
ima->ok= 0;