Table of Contents
The images are quite simple. They only have a width, height, format and the data of the image. The image also supports some functions to handle the data. Like fill with an color, bluring or blending one image over another.
The image data only stores the data of the pixels one after another. It begins with the top row and ends with the last row. Inside an row the pixels are stored from left to the right. The figure below shows the format TS_FORMAT_RGBA8. The data from the pixels containing 4 components and each of it has an width of 8 bit. So the resulting size of an pixel is 32 Bit (4 Bytes). They are stored in following order. Red (1 Byte), Green (1 Byte), Blue (1 Byte) and Alpha (1 Byte).
| Channel | Description |
|---|---|
| TS_CHANNEL_RED | Indicates the red channel. |
| TS_CHANNEL_GREEN | Indicates the green channel. |
| TS_CHANNEL_BLUE | Indicates the blue channel. |
| TS_CHANNEL_ALPHA | Indicates the alpha channel. |
| TS_CHANNEL_LUMINANCE | Indicates the luminance channel. (Luminance isn't supported by any format yet) |
| TS_CHANNELS_RGB | Contains the flags for red, green and the blue channel. |
| TS_CHANNELS_RGBA | Contains the flags for red, green, blue and the alpha channel. |
| TS_CHANNELS_LUMINANCE_ALPHA | Contains the flags for luminance and the alpha channel. (Luminance isn't supported by any format yet) |
Table 8.1. Channelsmasks
| Mode | Description |
|---|---|
| TS_MODE_REPLACE | The destination value will fully replaced with the source value. This mode is the default value for all channels instead the alphachannel. |
| TS_MODE_MODULATE | The destination and source value will be modulated. So if one of booth are zero the destination also will be zero. This value is the default value for the alpha channel. |
Table 8.2. Image modes