43 #define SDL_ALPHA_OPAQUE 255
44 #define SDL_ALPHA_TRANSPARENT 0
112 #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
114 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
115 ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
116 ((bits) << 8) | ((bytes) << 0))
118 #define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
119 #define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
120 #define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
121 #define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
122 #define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
123 #define SDL_BYTESPERPIXEL(X) \
124 (SDL_ISPIXELFORMAT_FOURCC(X) ? \
125 ((((X) == SDL_PIXELFORMAT_YUY2) || \
126 ((X) == SDL_PIXELFORMAT_UYVY) || \
127 ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
129 #define SDL_ISPIXELFORMAT_INDEXED(format) \
130 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
131 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
132 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
133 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
135 #define SDL_ISPIXELFORMAT_ALPHA(format) \
136 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
137 ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
138 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
139 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
140 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)))
143 #define SDL_ISPIXELFORMAT_FOURCC(format) \
144 ((format) && (SDL_PIXELFLAG(format) != 1))
259 #define SDL_Colour SDL_Color
368 int firstcolor,
int ncolors);
DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format)
Free an SDL_PixelFormat structure.
DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat *format, SDL_Palette *palette)
Set the palette for a pixel format structure.
DECLSPEC const char *SDLCALL SDL_GetPixelFormatName(Uint32 format)
Get the human readable name of a pixel format.
DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette *palette)
Free a palette created with SDL_AllocPalette().
DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
Convert a bpp and RGBA masks to an enumerated pixel format.
GLboolean GLboolean GLboolean GLboolean a
struct SDL_Palette SDL_Palette
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D)
DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Maps an RGBA quadruple to a pixel value for a given pixel format.
uint32_t Uint32
An unsigned 32-bit integer type.
struct SDL_Color SDL_Color
DECLSPEC SDL_PixelFormat *SDLCALL SDL_AllocFormat(Uint32 pixel_format)
Create an SDL_PixelFormat structure from a pixel format enum.
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 *ramp)
Calculate a 256 entry gamma ramp for a gamma value.
DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
Get the RGBA components from a pixel of the specified format.
DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors)
Create a palette structure with the specified number of color entries.
uint8_t Uint8
An unsigned 8-bit integer type.
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes)
DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask)
Convert one of the enumerated pixel formats to a bpp and RGBA masks.
DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b)
Maps an RGB triple to an opaque pixel value for a given pixel format.
DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, Uint8 *b)
Get the RGB components from a pixel of the specified format.
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble b
uint16_t Uint16
An unsigned 16-bit integer type.
struct SDL_PixelFormat SDL_PixelFormat
DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors)
Set a range of colors in a palette.