Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/IMB_imbuf_types.h
| Show All 16 Lines | |||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| #ifndef __IMB_IMBUF_TYPES_H__ | #ifndef __IMB_IMBUF_TYPES_H__ | ||||
| #define __IMB_IMBUF_TYPES_H__ | #define __IMB_IMBUF_TYPES_H__ | ||||
| #include "DNA_vec_types.h" /* for rcti */ | #include "DNA_vec_types.h" /* for rcti */ | ||||
| #include "IMB_imbuf_enums.h" | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { | ||||
| #endif | #endif | ||||
| /** \file | /** \file | ||||
| * \ingroup imbuf | * \ingroup imbuf | ||||
| * \brief Contains defines and structs used throughout the imbuf module. | * \brief Contains defines and structs used throughout the imbuf module. | ||||
| * \todo Clean up includes. | * \todo Clean up includes. | ||||
| ▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | |||||
| #endif | #endif | ||||
| typedef struct ImbFormatOptions { | typedef struct ImbFormatOptions { | ||||
| short flag; | short flag; | ||||
| /** quality serves dual purpose as quality number for jpeg or compression amount for png */ | /** quality serves dual purpose as quality number for jpeg or compression amount for png */ | ||||
| char quality; | char quality; | ||||
| } ImbFormatOptions; | } 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 { | typedef struct ImBuf { | ||||
| struct ImBuf *next, *prev; /**< allow lists of ImBufs, for caches or flipbooks */ | struct ImBuf *next, *prev; /**< allow lists of ImBufs, for caches or flipbooks */ | ||||
| /* dimensions */ | /* dimensions */ | ||||
| /** Width and Height of our image buffer. | /** Width and Height of our image buffer. | ||||
| * Should be 'unsigned int' since most formats use this. | * Should be 'unsigned int' since most formats use this. | ||||
| * but this is problematic with texture math in imagetexture.c | * but this is problematic with texture math in imagetexture.c | ||||
| * avoid problems and use int. - campbell */ | * avoid problems and use int. - campbell */ | ||||
| int x, y; | int x, y; | ||||
| /** Active amount of bits/bitplanes */ | /** Active amount of bits/bitplanes */ | ||||
| unsigned char planes; | unsigned char planes; | ||||
| /** Number of channels in `rect_float` (0 = 4 channel default) */ | /** Number of channels in `rect_float` (0 = 4 channel default) */ | ||||
| int channels; | int channels; | ||||
| /* flags */ | /* flags */ | ||||
| /** Controls which components should exist. */ | /** Controls which components should exist. */ | ||||
| int flags; | eImBufFlags flags; | ||||
| /** what is malloced internal, and can be freed */ | /** what is malloced internal, and can be freed */ | ||||
| int mall; | int mall; | ||||
| /* pixels */ | /* pixels */ | ||||
| /** Image pixel buffer (8bit representation): | /** Image pixel buffer (8bit representation): | ||||
| * - color space defaults to `sRGB`. | * - color space defaults to `sRGB`. | ||||
| * - alpha defaults to 'straight'. | * - alpha defaults to 'straight'. | ||||
| ▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines | |||||