A structure that contains pixel format information.
Defined in SDL_pixels.h
typedef struct SDL_PixelFormat
{
Uint32 format;
SDL_Palette *palette;
Uint8 BitsPerPixel;
Uint8 BytesPerPixel;
Uint8 padding[2];
Uint32 Rmask;
Uint32 Gmask;
Uint32 Bmask;
Uint32 Amask;
Uint8 Rloss;
Uint8 Gloss;
Uint8 Bloss;
Uint8 Aloss;
Uint8 Rshift;
Uint8 Gshift;
Uint8 Bshift;
Uint8 Ashift;
int refcount;
struct SDL_PixelFormat *next;
} SDL_PixelFormat;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.
An SDL_PixelFormat describes the format of the pixel data stored at the pixels field of an SDL_Surface. Every surface stores an SDL_PixelFormat in the format field.
If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential.
For information on modern pixel color spaces, see the following Wikipedia article: http://en.wikipedia.org/wiki/RGBA_color_space