diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-18 23:34:14 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-18 23:34:14 +0400 |
commit | 167dcc88c78b68540ecdd1abc3e26ade73d2d27c (patch) | |
tree | 7a08892060d76d236e00d8c268d9dc59f7eb3870 /source/blender/imbuf | |
parent | 58c9691d19ef0b1b60b84f4c0fcc8f1d4721171a (diff) |
Force movie clips always use default alpha mode, before this straight
alpha was used for them which doesn't work for cleaned footage stored
in EXR file format.
Perhaps we need to support configurable alpha mode for clips, but
that's for later (maybe even after release),
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/readimage.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c index 00bc78ee488..4d47d883444 100644 --- a/source/blender/imbuf/intern/readimage.c +++ b/source/blender/imbuf/intern/readimage.c @@ -75,6 +75,8 @@ ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags, char co if (type->load) { ibuf = type->load(mem, size, flags, effective_colorspace); if (ibuf) { + int alpha_flags; + if (colorspace) { if (ibuf->rect) { /* byte buffer is never internally converted to some standard space, @@ -86,11 +88,16 @@ ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags, char co BLI_strncpy(colorspace, effective_colorspace, IM_MAX_SPACE); } + if (flags & IB_alphamode_detect) + alpha_flags = ibuf->flags & IB_alphamode_premul; + else + alpha_flags = flags & IB_alphamode_premul; + if (flags & IB_ignore_alpha) { IMB_rectfill_alpha(ibuf, 1.0f); } else { - if (flags & IB_alphamode_premul) { + if (alpha_flags & IB_alphamode_premul) { if (ibuf->rect) { IMB_unpremultiply_alpha(ibuf); } |