SDL_PixelFormat
A structure that contains pixel format information.
Data Fields
palette |
a palette associated with this pixel format |
|
Uint8 |
BitsPerPixel |
the number of significant bits in a pixel value, eg: 8, 15, 16, 24, 32 |
Uint8 |
BytesPerPixel |
the number of bytes required to hold a pixel value, eg: 1, 2, 3, 4; see Remarks for related data type |
Uint8 |
Rloss |
(internal use) |
Uint8 |
Gloss |
(internal use) |
Uint8 |
Bloss |
(internal use) |
Uint8 |
Aloss |
(internal use) |
Uint8 |
Rshift |
(internal use) |
Uint8 |
Gshift |
(internal use) |
Uint8 |
Bshift |
(internal use) |
Uint8 |
Bshift |
(internal use) |
Uint8 |
Ashift |
(internal use) |
Uint32 |
Rmask |
a mask representing the location of the red component of the pixel |
Uint32 |
Gmask |
a mask representing the location of the green component of the pixel |
Uint32 |
Bmask |
a mask representing the location of the blue component of the pixel |
Uint32 |
Amask |
a mask representing the location of the alpha component of the pixel or 0 if the pixel format doesn't have any alpha information |
Code Examples
You can add your code example here
Remarks
Everything in the pixel format structure is read-only.
A pixel format has either a palette or masks. If a palette is used Rmask, Gmask, Bmask, and Amask will be 0.
The data types used to represent pixels are as follows:
Bytes Per Pixel |
Related Data Types |
1 |
Uint8 |
2 |
Uint16 |
3 |
tuple of Uint8 RGB values |
4 |
Uint32 |
Related Structures
