From 297261eb906c56c7decf4401e6a3e06cec1691e8 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 6 Mar 2020 12:08:03 +0100 Subject: CodeCleanup: Added enums to opengl render functions Motivation the functions get 3 different kind of flag parameters (ImBuf, DrawType, OffscreenRendering) the naming of the flags were not clear, leading to mistakes and unnecessary time spend debugging. --- source/blender/imbuf/IMB_imbuf_types.h | 65 +++++++++++++++++----------------- 1 file changed, 32 insertions(+), 33 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index 3559a7ca387..4a5f8cc1bfe 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -141,6 +141,38 @@ typedef struct ImbFormatOptions { char quality; } ImbFormatOptions; +/** + * \name Imbuf Component flags + * \brief These flags determine the components of an ImBuf struct. + * + * \{ */ + +typedef enum eImBufFlags { + IB_rect = 1 << 0, + IB_test = 1 << 1, + IB_zbuf = 1 << 3, + IB_mem = 1 << 4, + IB_rectfloat = 1 << 5, + IB_zbuffloat = 1 << 6, + IB_multilayer = 1 << 7, + IB_metadata = 1 << 8, + IB_animdeinterlace = 1 << 9, + IB_tiles = 1 << 10, + IB_tilecache = 1 << 11, + /** indicates whether image on disk have premul alpha */ + IB_alphamode_premul = 1 << 12, + /** if this flag is set, alpha mode would be guessed from file */ + IB_alphamode_detect = 1 << 13, + /* alpha channel is unrelated to RGB and should not affect it */ + IB_alphamode_channel_packed = 1 << 14, + /** ignore alpha on load and substitute it with 1.0f */ + IB_alphamode_ignore = 1 << 15, + IB_thumbnail = 1 << 16, + IB_multiview = 1 << 17, + IB_halffloat = 1 << 18, +} eImBufFlags; + +/** \} */ typedef struct ImBuf { struct ImBuf *next, *prev; /**< allow lists of ImBufs, for caches or flipbooks */ @@ -267,39 +299,6 @@ enum { IB_PERSISTENT = (1 << 5), }; -/** - * \name Imbuf Component flags - * \brief These flags determine the components of an ImBuf struct. - * - * \{ */ - -enum { - IB_rect = 1 << 0, - IB_test = 1 << 1, - IB_zbuf = 1 << 3, - IB_mem = 1 << 4, - IB_rectfloat = 1 << 5, - IB_zbuffloat = 1 << 6, - IB_multilayer = 1 << 7, - IB_metadata = 1 << 8, - IB_animdeinterlace = 1 << 9, - IB_tiles = 1 << 10, - IB_tilecache = 1 << 11, - /** indicates whether image on disk have premul alpha */ - IB_alphamode_premul = 1 << 12, - /** if this flag is set, alpha mode would be guessed from file */ - IB_alphamode_detect = 1 << 13, - /* alpha channel is unrelated to RGB and should not affect it */ - IB_alphamode_channel_packed = 1 << 14, - /** ignore alpha on load and substitute it with 1.0f */ - IB_alphamode_ignore = 1 << 15, - IB_thumbnail = 1 << 16, - IB_multiview = 1 << 17, - IB_halffloat = 1 << 18, -}; - -/** \} */ - /** * \name Imbuf preset profile tags * \brief Some predefined color space profiles that 8 bit imbufs can represent -- cgit v1.2.3