zenilib: zenilib/jni/external/sdl/SDL/SDL_pixels.h File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Macros | Typedefs | Enumerations | Functions
SDL_pixels.h File Reference
`#include "begin_code.h"`
`#include "close_code.h"`

Go to the source code of this file.

## Classes

struct | SDL_Color
struct | SDL_Palette
struct | SDL_PixelFormat

## Macros

#define | SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
#define | SDL_BYTESPERPIXEL(X)
#define | SDL_Colour SDL_Color
#define | SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes)
#define | SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
#define | SDL_ISPIXELFORMAT_ALPHA(format)
#define | SDL_ISPIXELFORMAT_FOURCC(format) ((format) && (SDL_PIXELFLAG(format) != 1))
#define | SDL_ISPIXELFORMAT_INDEXED(format)
#define | SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
#define | SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
#define | SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
#define | SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
Transparency definitions
These define alpha as the opacity of a surface.
#define | SDL_ALPHA_OPAQUE 255
#define | SDL_ALPHA_TRANSPARENT 0

## Typedefs

typedef struct SDL_Color | SDL_Color
typedef struct SDL_Palette | SDL_Palette
typedef struct SDL_PixelFormat | SDL_PixelFormat

## Enumerations

enum

{
SDL_PIXELTYPE_UNKNOWN, SDL_PIXELTYPE_INDEX1, SDL_PIXELTYPE_INDEX4, SDL_PIXELTYPE_INDEX8,
SDL_PIXELTYPE_PACKED8, SDL_PIXELTYPE_PACKED16, SDL_PIXELTYPE_PACKED32, SDL_PIXELTYPE_ARRAYU8,
SDL_PIXELTYPE_ARRAYU16, SDL_PIXELTYPE_ARRAYU32, SDL_PIXELTYPE_ARRAYF16, SDL_PIXELTYPE_ARRAYF32
}

enum | { SDL_BITMAPORDER_NONE, SDL_BITMAPORDER_4321, SDL_BITMAPORDER_1234 }
enum | { SDL_PACKEDORDER_NONE, SDL_PACKEDORDER_XRGB, SDL_PACKEDORDER_RGBX, SDL_PACKEDORDER_ARGB, SDL_PACKEDORDER_RGBA, SDL_PACKEDORDER_XBGR, SDL_PACKEDORDER_BGRX, SDL_PACKEDORDER_ABGR, SDL_PACKEDORDER_BGRA }
enum | { SDL_ARRAYORDER_NONE, SDL_ARRAYORDER_RGB, SDL_ARRAYORDER_RGBA, SDL_ARRAYORDER_ARGB, SDL_ARRAYORDER_BGR, SDL_ARRAYORDER_BGRA, SDL_ARRAYORDER_ABGR }
enum | { SDL_PACKEDLAYOUT_NONE, SDL_PACKEDLAYOUT_332, SDL_PACKEDLAYOUT_4444, SDL_PACKEDLAYOUT_1555, SDL_PACKEDLAYOUT_5551, SDL_PACKEDLAYOUT_565, SDL_PACKEDLAYOUT_8888, SDL_PACKEDLAYOUT_2101010, SDL_PACKEDLAYOUT_1010102 }

enum

{
SDL_PIXELFORMAT_UNKNOWN, SDL_PIXELFORMAT_INDEX1LSB, SDL_PIXELFORMAT_INDEX1MSB, SDL_PIXELFORMAT_INDEX4LSB,
SDL_PIXELFORMAT_INDEX4MSB, SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_RGB332, SDL_PIXELFORMAT_RGB444,
SDL_PIXELFORMAT_RGB555, SDL_PIXELFORMAT_BGR555, SDL_PIXELFORMAT_ARGB4444, SDL_PIXELFORMAT_RGBA4444,
SDL_PIXELFORMAT_ABGR4444, SDL_PIXELFORMAT_BGRA4444, SDL_PIXELFORMAT_ARGB1555, SDL_PIXELFORMAT_RGBA5551,
SDL_PIXELFORMAT_ABGR1555, SDL_PIXELFORMAT_BGRA5551, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_BGR565,
SDL_PIXELFORMAT_RGB24, SDL_PIXELFORMAT_BGR24, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGBX8888,
SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGRX8888, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGBA8888,
SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB2101010, SDL_PIXELFORMAT_YV12,
SDL_PIXELFORMAT_IYUV, SDL_PIXELFORMAT_YUY2, SDL_PIXELFORMAT_UYVY, SDL_PIXELFORMAT_YVYU =
}

## Functions

DECLSPEC SDL_PixelFormat *SDLCALL | SDL_AllocFormat (Uint32 pixel_format)
| Create an SDL_PixelFormat structure from a pixel format enum. More...
DECLSPEC SDL_Palette *SDLCALL | SDL_AllocPalette (int ncolors)
| Create a palette structure with the specified number of color entries. More...
DECLSPEC void SDLCALL | SDL_CalculateGammaRamp (float gamma, Uint16 *ramp)
| Calculate a 256 entry gamma ramp for a gamma value. More...
DECLSPEC void SDLCALL | SDL_FreeFormat (SDL_PixelFormat *format)
| Free an SDL_PixelFormat structure. More...
DECLSPEC void SDLCALL | SDL_FreePalette (SDL_Palette *palette)
| Free a palette created with SDL_AllocPalette(). More...
DECLSPEC const char *SDLCALL | SDL_GetPixelFormatName (Uint32 format)
| Get the human readable name of a pixel format. More...
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. More...
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. More...
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. More...
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. More...
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. More...
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. More...
DECLSPEC int SDLCALL | SDL_SetPaletteColors (SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors)
| Set a range of colors in a palette. More...
DECLSPEC int SDLCALL | SDL_SetPixelFormatPalette (SDL_PixelFormat *format, SDL_Palette *palette)
| Set the palette for a pixel format structure. More...

## Detailed Description

Header for the enumerated pixel format definitions.

Definition in file SDL_pixels.h.

## Macro Definition Documentation

#define SDL_ALPHA_OPAQUE 255

Definition at line 43 of file SDL_pixels.h.

Referenced by BlitARGBto555PixelAlpha(), BlitARGBto565PixelAlpha(), BlitRGBtoRGBPixelAlpha(), CorrectAlphaChannel(), SDL_DitherColors(), SDL_LoadBMP_RW(), SDL_MapRGB(), and SDL_SetColorKey().

#define SDL_ALPHA_TRANSPARENT 0

Definition at line 44 of file SDL_pixels.h.

Referenced by SDL_SetColorKey().

#define SDL_BITSPERPIXEL | ( |  | X | ) | (((X) >> 8) & 0xFF)

Definition at line 122 of file SDL_pixels.h.

Referenced by cmpmodes(), SDL_GetClosestDisplayModeForDisplay(), and SDL_PixelFormatEnumToMasks().

#define SDL_BYTESPERPIXEL | ( |  | X | ) |

Value:
(SDL_ISPIXELFORMAT_FOURCC(X) ? \
((((X) == SDL_PIXELFORMAT_YUY2) || \
((X) == SDL_PIXELFORMAT_UYVY) || \
((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
SDL_PIXELFORMAT_YVYU
Definition: SDL_pixels.h:248
SDL_PIXELFORMAT_UYVY
Definition: SDL_pixels.h:246
SDL_ISPIXELFORMAT_FOURCC
#define SDL_ISPIXELFORMAT_FOURCC(format)
Definition: SDL_pixels.h:143
SDL_PIXELFORMAT_YUY2
Definition: SDL_pixels.h:244

Definition at line 123 of file SDL_pixels.h.

Referenced by SDL_ConvertPixels(), SDL_CreateTexture(), SDL_CreateWindowTexture(), SDL_LockTextureNative(), SDL_PixelFormatEnumToMasks(), SDL_RenderReadPixels(), SDL_SW_CopyYUVToRGB(), SDL_SW_SetupYUVDisplay(), SDL_UnlockTextureNative(), SDL_UpdateTextureNative(), SDL_UpdateTextureYUV(), and SDL_UpdateTextureYUVPlanar().

#define SDL_Colour SDL_Color

Definition at line 259 of file SDL_pixels.h.

#define SDL_DEFINE_PIXELFORMAT | ( |  | type,
|  |  | order,
|  |  | layout,
|  |  | bits,
|  |  | bytes
| ) |  |

Value:
((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
((bits) << 8) | ((bytes) << 0))
type
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
Definition: gl2ext.h:845
bits
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: SDL_opengl.h:10449
order
GLuint GLdouble GLdouble GLint GLint order
Definition: glew.h:3337

Definition at line 114 of file SDL_pixels.h.

#define SDL_DEFINE_PIXELFOURCC | ( |  | A,
|  |  | B,
|  |  | C,
|  |  | D
| ) |  | SDL_FOURCC(A, B, C, D)

Definition at line 112 of file SDL_pixels.h.

#define SDL_ISPIXELFORMAT_ALPHA | ( |  | format | ) |

Value:
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)))
SDL_PACKEDORDER_RGBA
Definition: SDL_pixels.h:79
SDL_PIXELORDER
#define SDL_PIXELORDER(X)
Definition: SDL_pixels.h:120
format
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl2ext.h:845
SDL_PACKEDORDER_ARGB
Definition: SDL_pixels.h:78
SDL_PACKEDORDER_ABGR
Definition: SDL_pixels.h:82
SDL_PACKEDORDER_BGRA
Definition: SDL_pixels.h:83
SDL_ISPIXELFORMAT_FOURCC
#define SDL_ISPIXELFORMAT_FOURCC(format)
Definition: SDL_pixels.h:143

Definition at line 135 of file SDL_pixels.h.

Referenced by GetClosestSupportedFormat(), SDL_CreateTextureFromSurface(), and SDL_CreateWindowTexture().

#define SDL_ISPIXELFORMAT_FOURCC | ( |  | format | ) | ((format) && (SDL_PIXELFLAG(format) != 1))

Definition at line 143 of file SDL_pixels.h.

Referenced by GetClosestSupportedFormat(), SDL_CalculateBlit(), SDL_ConvertPixels(), SDL_CreateTexture(), SDL_CreateTextureFromSurface(), SDL_CreateWindowTexture(), and SDL_PixelFormatEnumToMasks().

#define SDL_ISPIXELFORMAT_INDEXED | ( |  | format | ) |

Value:
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
SDL_PIXELTYPE_INDEX8
Definition: SDL_pixels.h:53
SDL_PIXELTYPE_INDEX1
Definition: SDL_pixels.h:51
format
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl2ext.h:845
SDL_PIXELTYPE_INDEX4
Definition: SDL_pixels.h:52
SDL_PIXELTYPE
#define SDL_PIXELTYPE(X)
Definition: SDL_pixels.h:119
SDL_ISPIXELFORMAT_FOURCC
#define SDL_ISPIXELFORMAT_FOURCC(format)
Definition: SDL_pixels.h:143

Definition at line 129 of file SDL_pixels.h.

Referenced by SDL_AllocFormat(), SDL_CalculateBlit(), SDL_CreateRGBSurface(), SDL_CreateSurfaceOnStack(), SDL_CreateTexture(), SDL_LowerBlitScaled(), and SDL_MapSurface().

#define SDL_PIXELFLAG | ( |  | X | ) | (((X) >> 28) & 0x0F)

Definition at line 118 of file SDL_pixels.h.

#define SDL_PIXELLAYOUT | ( |  | X | ) | (((X) >> 16) & 0x0F)

Definition at line 121 of file SDL_pixels.h.

Referenced by cmpmodes(), and SDL_PixelFormatEnumToMasks().

#define SDL_PIXELORDER | ( |  | X | ) | (((X) >> 20) & 0x0F)

Definition at line 120 of file SDL_pixels.h.

Referenced by SDL_PixelFormatEnumToMasks().

#define SDL_PIXELTYPE | ( |  | X | ) | (((X) >> 24) & 0x0F)

Definition at line 119 of file SDL_pixels.h.

Referenced by SDL_GetClosestDisplayModeForDisplay(), and SDL_PixelFormatEnumToMasks().

## Typedef Documentation

typedef struct SDL_Color SDL_Color

typedef struct SDL_Palette SDL_Palette

typedef struct SDL_PixelFormat SDL_PixelFormat

Note
  Everything in the pixel format structure is read-only.

## Enumeration Type Documentation

anonymous enum

Pixel type.

Enumerator
SDL_PIXELTYPE_UNKNOWN |
SDL_PIXELTYPE_INDEX1 |
SDL_PIXELTYPE_INDEX4 |
SDL_PIXELTYPE_INDEX8 |
SDL_PIXELTYPE_PACKED8 |
SDL_PIXELTYPE_PACKED16 |
SDL_PIXELTYPE_PACKED32 |
SDL_PIXELTYPE_ARRAYU8 |
SDL_PIXELTYPE_ARRAYU16 |
SDL_PIXELTYPE_ARRAYU32 |
SDL_PIXELTYPE_ARRAYF16 |
SDL_PIXELTYPE_ARRAYF32 |

Definition at line 48 of file SDL_pixels.h.

anonymous enum

Bitmap pixel order, high bit -> low bit.

Enumerator
SDL_BITMAPORDER_NONE |
SDL_BITMAPORDER_4321 |
SDL_BITMAPORDER_1234 |

Definition at line 65 of file SDL_pixels.h.

anonymous enum

Packed component order, high bit -> low bit.

Enumerator
SDL_PACKEDORDER_NONE |
SDL_PACKEDORDER_XRGB |
SDL_PACKEDORDER_RGBX |
SDL_PACKEDORDER_ARGB |
SDL_PACKEDORDER_RGBA |
SDL_PACKEDORDER_XBGR |
SDL_PACKEDORDER_BGRX |
SDL_PACKEDORDER_ABGR |
SDL_PACKEDORDER_BGRA |

Definition at line 73 of file SDL_pixels.h.

anonymous enum

Array component order, low byte -> high byte.

Enumerator
SDL_ARRAYORDER_NONE |
SDL_ARRAYORDER_RGB |
SDL_ARRAYORDER_RGBA |
SDL_ARRAYORDER_ARGB |
SDL_ARRAYORDER_BGR |
SDL_ARRAYORDER_BGRA |
SDL_ARRAYORDER_ABGR |

Definition at line 87 of file SDL_pixels.h.

anonymous enum

Packed component layout.

Enumerator
SDL_PACKEDLAYOUT_NONE |
SDL_PACKEDLAYOUT_332 |
SDL_PACKEDLAYOUT_4444 |
SDL_PACKEDLAYOUT_1555 |
SDL_PACKEDLAYOUT_5551 |
SDL_PACKEDLAYOUT_565 |
SDL_PACKEDLAYOUT_8888 |
SDL_PACKEDLAYOUT_2101010 |
SDL_PACKEDLAYOUT_1010102 |

Definition at line 99 of file SDL_pixels.h.

anonymous enum

Enumerator
SDL_PIXELFORMAT_UNKNOWN |
SDL_PIXELFORMAT_INDEX1LSB |
SDL_PIXELFORMAT_INDEX1MSB |
SDL_PIXELFORMAT_INDEX4LSB |
SDL_PIXELFORMAT_INDEX4MSB |
SDL_PIXELFORMAT_INDEX8 |
SDL_PIXELFORMAT_RGB332 |
SDL_PIXELFORMAT_RGB444 |
SDL_PIXELFORMAT_RGB555 |
SDL_PIXELFORMAT_BGR555 |
SDL_PIXELFORMAT_ARGB4444 |
SDL_PIXELFORMAT_RGBA4444 |
SDL_PIXELFORMAT_ABGR4444 |
SDL_PIXELFORMAT_BGRA4444 |
SDL_PIXELFORMAT_ARGB1555 |
SDL_PIXELFORMAT_RGBA5551 |
SDL_PIXELFORMAT_ABGR1555 |
SDL_PIXELFORMAT_BGRA5551 |
SDL_PIXELFORMAT_RGB565 |
SDL_PIXELFORMAT_BGR565 |
SDL_PIXELFORMAT_RGB24 |
SDL_PIXELFORMAT_BGR24 |
SDL_PIXELFORMAT_RGB888 |
SDL_PIXELFORMAT_RGBX8888 |
SDL_PIXELFORMAT_BGR888 |
SDL_PIXELFORMAT_BGRX8888 |
SDL_PIXELFORMAT_ARGB8888 |
SDL_PIXELFORMAT_RGBA8888 |
SDL_PIXELFORMAT_ABGR8888 |
SDL_PIXELFORMAT_BGRA8888 |
SDL_PIXELFORMAT_ARGB2101010 |
SDL_PIXELFORMAT_YV12 | Planar mode: Y + V + U (3 planes)
SDL_PIXELFORMAT_IYUV | Planar mode: Y + U + V (3 planes)
SDL_PIXELFORMAT_YUY2 | Packed mode: Y0+U0+Y1+V0 (1 plane)
SDL_PIXELFORMAT_UYVY | Packed mode: U0+Y0+V0+Y1 (1 plane)
SDL_PIXELFORMAT_YVYU | Packed mode: Y0+V0+Y1+U0 (1 plane)

Definition at line 147 of file SDL_pixels.h.

## Function Documentation

DECLSPEC SDL_PixelFormat* SDLCALL SDL_AllocFormat | ( | Uint32 | pixel_format | ) |

Create an SDL_PixelFormat structure from a pixel format enum.

Definition at line 486 of file SDL_pixels.c.

References SDL_PixelFormat::format, formats, SDL_PixelFormat::next, NULL, SDL_PixelFormat::refcount, SDL_free(), SDL_InitFormat(), SDL_InvalidParamError, SDL_ISPIXELFORMAT_INDEXED, SDL_malloc(), and SDL_OutOfMemory.

Referenced by SDL_ConvertSurfaceFormat(), SDL_CreateRGBSurface(), and SDL_CreateTextureFromSurface().

DECLSPEC SDL_Palette* SDLCALL SDL_AllocPalette | ( | int | ncolors | ) |

Create a palette structure with the specified number of color entries.

Returns
  A new palette, or NULL if there wasn't enough memory.

Note
  The palette entries are initialized to white.

See Also
  SDL_FreePalette()

Definition at line 615 of file SDL_pixels.c.

References SDL_Palette::colors, SDL_Palette::ncolors, NULL, SDL_Palette::refcount, SDL_free(), SDL_InvalidParamError, SDL_malloc(), SDL_memset(), SDL_OutOfMemory, and SDL_Palette::version.

Referenced by SDL_CreateRGBSurface().

DECLSPEC void SDLCALL SDL_CalculateGammaRamp | ( | float | gamma,
|  | Uint16 * | ramp
| ) |  |

Calculate a 256 entry gamma ramp for a gamma value.

Definition at line 1086 of file SDL_pixels.c.

References i, int, NULL, SDL_InvalidParamError, and SDL_pow().

Referenced by SDL_SetWindowBrightness().

DECLSPEC void SDLCALL SDL_FreeFormat | ( | SDL_PixelFormat * | format | ) |

Free an SDL_PixelFormat structure.

Definition at line 584 of file SDL_pixels.c.

References SDL_PixelFormat::next, SDL_PixelFormat::palette, SDL_PixelFormat::refcount, SDL_free(), SDL_FreePalette(), and SDL_InvalidParamError.

Referenced by SDL_ConvertSurfaceFormat(), SDL_CreateTextureFromSurface(), and SDL_FreeSurface().

DECLSPEC void SDLCALL SDL_FreePalette | ( | SDL_Palette * | palette | ) |

Free a palette created with SDL_AllocPalette().

See Also
  SDL_AllocPalette()

Definition at line 701 of file SDL_pixels.c.

References SDL_Palette::colors, SDL_Palette::refcount, SDL_free(), and SDL_InvalidParamError.

Referenced by SDL_CreateRGBSurface(), SDL_FreeFormat(), and SDL_SetPixelFormatPalette().

DECLSPEC const char* SDLCALL SDL_GetPixelFormatName | ( | Uint32 | format | ) |

Get the human readable name of a pixel format.

Definition at line 86 of file SDL_pixels.c.

References CASE, SDL_PIXELFORMAT_ABGR1555, SDL_PIXELFORMAT_ABGR4444, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB1555, SDL_PIXELFORMAT_ARGB2101010, SDL_PIXELFORMAT_ARGB4444, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR24, SDL_PIXELFORMAT_BGR555, SDL_PIXELFORMAT_BGR565, SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGRA4444, SDL_PIXELFORMAT_BGRA5551, SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGRX8888, SDL_PIXELFORMAT_INDEX1LSB, SDL_PIXELFORMAT_INDEX1MSB, SDL_PIXELFORMAT_INDEX4LSB, SDL_PIXELFORMAT_INDEX4MSB, SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_IYUV, SDL_PIXELFORMAT_RGB24, SDL_PIXELFORMAT_RGB332, SDL_PIXELFORMAT_RGB444, SDL_PIXELFORMAT_RGB555, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGBA4444, SDL_PIXELFORMAT_RGBA5551, SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGBX8888, SDL_PIXELFORMAT_UYVY, SDL_PIXELFORMAT_YUY2, SDL_PIXELFORMAT_YV12, and SDL_PIXELFORMAT_YVYU.

Referenced by SDLTest_CommonInit().

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.

See Also
  SDL_GetRGBA

Definition at line 826 of file SDL_pixels.c.

References SDL_Color::b, SDL_PixelFormat::Bloss, SDL_PixelFormat::Bmask, SDL_PixelFormat::Bshift, SDL_Palette::colors, SDL_Color::g, SDL_PixelFormat::Gloss, SDL_PixelFormat::Gmask, SDL_PixelFormat::Gshift, SDL_Palette::ncolors, NULL, SDL_PixelFormat::palette, SDL_Color::r, SDL_PixelFormat::Rloss, SDL_PixelFormat::Rmask, SDL_PixelFormat::Rshift, and SDL_expand_byte.

Referenced by _rotateSurface().

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.

See Also
  SDL_GetRGB

Definition at line 849 of file SDL_pixels.c.

References SDL_Color::a, SDL_PixelFormat::Aloss, SDL_PixelFormat::Amask, SDL_PixelFormat::Ashift, SDL_Color::b, SDL_PixelFormat::Bloss, SDL_PixelFormat::Bmask, SDL_PixelFormat::Bshift, SDL_Palette::colors, SDL_Color::g, SDL_PixelFormat::Gloss, SDL_PixelFormat::Gmask, SDL_PixelFormat::Gshift, SDL_Palette::ncolors, NULL, SDL_PixelFormat::palette, SDL_Color::r, SDL_PixelFormat::Rloss, SDL_PixelFormat::Rmask, SDL_PixelFormat::Rshift, and SDL_expand_byte.

Referenced by RecursivelyCalculateShapeTree(), SDL_CalculateShapeBitmap(), SDL_ConvertSurface(), SDL_DrawLine2(), SDL_DrawLine4(), and SDLTest_CompareSurfaces().

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.

See Also
  SDL_MapRGBA

Definition at line 799 of file SDL_pixels.c.

References SDL_PixelFormat::Amask, SDL_PixelFormat::Bloss, SDL_PixelFormat::Bshift, SDL_PixelFormat::Gloss, SDL_PixelFormat::Gshift, NULL, SDL_PixelFormat::palette, SDL_PixelFormat::Rloss, SDL_PixelFormat::Rshift, SDL_ALPHA_OPAQUE, and SDL_FindColor().

Referenced by _rotateSurface().

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.

See Also
  SDL_MapRGB

Definition at line 812 of file SDL_pixels.c.

References SDL_PixelFormat::Aloss, SDL_PixelFormat::Amask, SDL_PixelFormat::Ashift, SDL_PixelFormat::Bloss, SDL_PixelFormat::Bshift, SDL_PixelFormat::Gloss, SDL_PixelFormat::Gshift, NULL, SDL_PixelFormat::palette, SDL_PixelFormat::Rloss, SDL_PixelFormat::Rshift, and SDL_FindColor().

Referenced by SDL_ConvertSurface(), SW_RenderClear(), SW_RenderDrawLines(), SW_RenderDrawPoints(), and SW_RenderFillRects().

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.

Returns
  The pixel format, or SDL_PIXELFORMAT_UNKNOWN if the conversion wasn't possible.

See Also
  SDL_PixelFormatEnumToMasks()

Definition at line 291 of file SDL_pixels.c.

References SDL_PIXELFORMAT_ABGR1555, SDL_PIXELFORMAT_ABGR4444, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB1555, SDL_PIXELFORMAT_ARGB2101010, SDL_PIXELFORMAT_ARGB4444, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR24, SDL_PIXELFORMAT_BGR555, SDL_PIXELFORMAT_BGR565, SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGRA4444, SDL_PIXELFORMAT_BGRA5551, SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGRX8888, SDL_PIXELFORMAT_INDEX1MSB, SDL_PIXELFORMAT_INDEX4MSB, SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_RGB24, SDL_PIXELFORMAT_RGB332, SDL_PIXELFORMAT_RGB444, SDL_PIXELFORMAT_RGB555, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGBA4444, SDL_PIXELFORMAT_RGBA5551, SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGBX8888, and SDL_PIXELFORMAT_UNKNOWN.

Referenced by SDL_CreateRGBSurface().

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.

Returns
  SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.

See Also
  SDL_MasksToPixelFormatEnum()

Definition at line 132 of file SDL_pixels.c.

References SDL_BITSPERPIXEL, SDL_BYTESPERPIXEL, SDL_FALSE, SDL_ISPIXELFORMAT_FOURCC, SDL_PACKEDLAYOUT_1010102, SDL_PACKEDLAYOUT_1555, SDL_PACKEDLAYOUT_2101010, SDL_PACKEDLAYOUT_332, SDL_PACKEDLAYOUT_4444, SDL_PACKEDLAYOUT_5551, SDL_PACKEDLAYOUT_565, SDL_PACKEDLAYOUT_8888, SDL_PACKEDORDER_ABGR, SDL_PACKEDORDER_ARGB, SDL_PACKEDORDER_BGRA, SDL_PACKEDORDER_BGRX, SDL_PACKEDORDER_RGBA, SDL_PACKEDORDER_RGBX, SDL_PACKEDORDER_XBGR, SDL_PACKEDORDER_XRGB, SDL_PIXELFORMAT_BGR24, SDL_PIXELFORMAT_RGB24, SDL_PIXELLAYOUT, SDL_PIXELORDER, SDL_PIXELTYPE, SDL_PIXELTYPE_PACKED16, SDL_PIXELTYPE_PACKED32, SDL_PIXELTYPE_PACKED8, SDL_SetError(), and SDL_TRUE.

Referenced by SDL_CreateWindowFramebuffer(), SDL_InitFormat(), SDL_SW_CopyYUVToRGB(), SDL_SW_SetupYUVDisplay(), SDLTest_CommonInit(), and SW_CreateTexture().

DECLSPEC int SDLCALL SDL_SetPaletteColors | ( | SDL_Palette * | palette,
|  | const SDL_Color * | colors,
|  | int | firstcolor,
|  | int | ncolors
| ) |  |

Set a range of colors in a palette.

Parameters

  palette | The palette to modify.
  colors | An array of colors to copy into the palette.
  firstcolor | The index of the first palette entry to modify.
  ncolors | The number of entries to modify.

Returns
  0 on success, or -1 if not all of the colors could be set.

Definition at line 674 of file SDL_pixels.c.

References SDL_Palette::colors, SDL_Palette::ncolors, SDL_memcpy(), and SDL_Palette::version.

DECLSPEC int SDLCALL SDL_SetPixelFormatPalette | ( | SDL_PixelFormat * | format,
|  | SDL_Palette * | palette
| ) |  |

Set the palette for a pixel format structure.

Definition at line 646 of file SDL_pixels.c.

References SDL_PixelFormat::BitsPerPixel, SDL_Palette::ncolors, SDL_PixelFormat::palette, SDL_Palette::refcount, SDL_FreePalette(), and SDL_SetError().

Referenced by SDL_SetSurfacePalette().