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:
authorMatt Ebb <matt@mke3.net>2010-06-17 11:20:12 +0400
committerMatt Ebb <matt@mke3.net>2010-06-17 11:20:12 +0400
commit3173232bfa1e6878088cdbb0134fe709a1f757bd (patch)
tree0f8db23abdfcdaa72ff0016e94de2747e5b44544 /source/blender/blenkernel/intern/image.c
parenta8f6a198a6a88a803f2fa871ec96bd74713c3756 (diff)
Fix [#22610] Alpha problem with textureswhen Brightness > 1 or Contrast < 1
* Enabled premultiplication for packed images * Added pack/unpack operator to image template * Moved brightness/contrast corrections to after de-premultiplication in image texture sampling
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index ef95139abda..f06e9302a60 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1715,7 +1715,10 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
/* is there a PackedFile with this image ? */
if (ima->packedfile) {
- ibuf = IMB_ibImageFromMemory((unsigned char*)ima->packedfile->data, ima->packedfile->size, IB_rect|IB_multilayer);
+ flag = IB_rect|IB_multilayer;
+ if(ima->flag & IMA_DO_PREMUL) flag |= IB_premul;
+
+ ibuf = IMB_ibImageFromMemory((unsigned char*)ima->packedfile->data, ima->packedfile->size, flag);
}
else {
flag= IB_rect|IB_multilayer|IB_metadata;