diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-19 12:37:08 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-19 12:37:08 +0400 |
commit | e5a135e0b26d7a268e7507ffb1be2f2fcc1b0b9c (patch) | |
tree | 82bd3feee50e121dd1e5dcbd6957b1e0ba3ac742 /source/blender/blenkernel/BKE_image.h | |
parent | c68d5325d0706305937372e42bd981197440de24 (diff) |
Fixes for alpha mode do_versions code
Before this change only old flag "Premultiply" was used to
detect alpha mode, which is not enough actually.
Now the logic here is:
- If "Premultiply" was enabled it is likely float image with
straight alpha, which shall be premultiplied before usage.
In this case image/sequence Alpha Mode is set to Straight.
- Otherwise use default alpha mode for image format based on
an extension. This could fail in some cases like TIFF, but
this wasn't handled fully correct in older blender anyway.
Initial discovered issue was that EXR images saved in older
Blender versions were set to Straight alpha mode, which is
obviously a straight way to lots of headache.
Diffstat (limited to 'source/blender/blenkernel/BKE_image.h')
-rw-r--r-- | source/blender/blenkernel/BKE_image.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index d12b048bc96..dd7e06259bd 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -152,6 +152,9 @@ void BKE_image_pool_free(struct ImagePool *pool); struct ImBuf *BKE_image_pool_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, struct ImagePool *pool); void BKE_image_pool_release_ibuf(struct Image *ima, struct ImBuf *ibuf, struct ImagePool *pool); +/* set an alpha mode based on file extension */ +void BKE_image_alpha_mode_from_extension(struct Image *image); + /* returns a new image or NULL if it can't load */ struct Image *BKE_image_load(struct Main *bmain, const char *filepath); /* returns existing Image when filename/type is same (frame optional) */ |