frei0r
|
Macros | |
#define | F0R_COLOR_MODEL_BGRA8888 0 |
#define | F0R_COLOR_MODEL_RGBA8888 1 |
#define | F0R_COLOR_MODEL_PACKED32 2 |
List of supported color models.
Note: the color models are endian independent, because the color components are defined by their positon in memory, not by their significance in an uint32_t value.
For effects that work on the color components, RGBA8888 is the recommended color model for frei0r-1.2 effects. For effects that only work on pixels, PACKED32 is the recommended color model since it helps the application to avoid unnecessary color conversions.
Effects can choose an appropriate color model, applications must support all color models and do conversions if necessary. Source effects must not use the PACKED32 color model because the application must know in which color model the created framebuffers are represented.
For each color model, a frame consists of width*height pixels which are stored row-wise and consecutively in memory. The size of a pixel is 4 bytes. There is no extra pitch parameter (i.e. the pitch is simply width*4).
The following additional constraints must be honored:
These constraints make sure that each line is stored at an address aligned to 16 byte.
#define F0R_COLOR_MODEL_BGRA8888 0 |
#define F0R_COLOR_MODEL_PACKED32 2 |
In PACKED32, each pixel is represented by 4 consecutive bytes, but it is not defined how the color componets are stored. The true color format could be RGBA8888, BGRA8888, a packed 32 bit YUV format, or any other color format that stores pixels in 32 bit.
This is useful for effects that don't work on color but only on pixels (for example a mirror effect).
Note that source effects must not use this color model.
#define F0R_COLOR_MODEL_RGBA8888 1 |