From 7aaa7aa9dd79b8c6e37f351fd67a93ba07fbb883 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 18 May 2019 20:52:20 +0200 Subject: Images: change alpha settings to support channel packing This also replaces the Use Alpha setting. We now have these alpha modes: * Straight: store RGB and alpha channels separately with alpha acting as a mask, also known as unassociated alpha. * Premultiplied: transparent RGB pixels are multiplied by the alpha channel. The natural format for renders. * Channel Packed: different images are packed in the RGB and alpha channels, and they should not influence each other. Channel packing is commonly used by game engines to save memory. * None: ignore alpha channel from the file and make image fully opaque. Cycles OSL does not correctly support Channel Packed and None yet, we are missing fine control over the OpenImageIO texture cache to do that. Fixes T53672 --- source/blender/imbuf/IMB_imbuf.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/imbuf/IMB_imbuf.h') diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 674dc61cd9e..8574f33bce6 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -476,6 +476,9 @@ int imb_get_anim_type(const char *name); */ bool IMB_isfloat(struct ImBuf *ibuf); +/* Do byte/float and colorspace conversions need to take alpha into account? */ +bool IMB_alpha_affects_rgb(const struct ImBuf *ibuf); + /* create char buffer, color corrected if necessary, for ImBufs that lack one */ void IMB_rect_from_float(struct ImBuf *ibuf); void IMB_float_from_rect(struct ImBuf *ibuf); -- cgit v1.2.3