zenilib
0.5.3.0
|
#include "SDL_config.h"
#include "SDL_endian.h"
#include "SDL_video.h"
#include "SDL_sysvideo.h"
#include "SDL_blit.h"
#include "SDL_pixels_c.h"
#include "SDL_RLEaccel_c.h"
Go to the source code of this file.
Macros | |
#define | CASE(X) case X: return #X; |
Variables | |
static SDL_PixelFormat * | formats |
static Uint8 | lookup_0 [] |
static Uint8 | lookup_1 [] |
static Uint8 | lookup_2 [] |
static Uint8 | lookup_3 [] |
static Uint8 | lookup_4 [] |
static Uint8 | lookup_5 [] |
static Uint8 | lookup_6 [] |
static Uint8 | lookup_7 [] |
static Uint8 | lookup_8 [] |
Uint8 * | SDL_expand_byte [9] |
#define CASE | ( | X | ) | case X: return #X; |
Referenced by SDL_GetPixelFormatName().
|
static |
Definition at line 876 of file SDL_pixels.c.
References SDL_Color::a, SDL_Color::b, SDL_Palette::colors, SDL_Color::g, i, map, SDL_Palette::ncolors, NULL, SDL_Color::r, SDL_FindColor(), SDL_malloc(), SDL_memcmp(), and SDL_OutOfMemory.
Referenced by MapNto1(), and SDL_MapSurface().
|
static |
Definition at line 910 of file SDL_pixels.c.
References SDL_Color::a, ASSEMBLE_RGBA, SDL_Color::b, SDL_PixelFormat::BytesPerPixel, SDL_Palette::colors, G, SDL_Color::g, i, map, SDL_Palette::ncolors, NULL, SDL_PixelFormat::palette, R, SDL_Color::r, SDL_malloc(), and SDL_OutOfMemory.
Referenced by SDL_MapSurface().
|
static |
Definition at line 938 of file SDL_pixels.c.
References colors, SDL_Palette::colors, Map1to1(), SDL_Palette::ncolors, SDL_PixelFormat::palette, and SDL_DitherColors().
Referenced by SDL_MapSurface().
SDL_BlitMap* SDL_AllocBlitMap | ( | void | ) |
Definition at line 952 of file SDL_pixels.c.
References SDL_BlitInfo::a, SDL_BlitInfo::b, SDL_BlitInfo::g, SDL_BlitMap::info, map, NULL, SDL_BlitInfo::r, SDL_calloc(), and SDL_OutOfMemory.
Referenced by SDL_CreateRGBSurface().
SDL_PixelFormat* 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().
SDL_Palette* SDL_AllocPalette | ( | int | ncolors | ) |
Create a palette structure with the specified number of color entries.
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().
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().
int SDL_CalculatePitch | ( | SDL_Surface * | surface | ) |
Definition at line 746 of file SDL_pixels.c.
References SDL_PixelFormat::BitsPerPixel, SDL_PixelFormat::BytesPerPixel, SDL_Surface::format, and SDL_Surface::w.
Referenced by SDL_CreateRGBSurface().
Definition at line 718 of file SDL_pixels.c.
References SDL_Color::a, SDL_Color::b, SDL_Color::g, i, SDL_Color::r, and SDL_ALPHA_OPAQUE.
Referenced by MapNto1().
Definition at line 770 of file SDL_pixels.c.
References SDL_Color::a, SDL_Color::b, SDL_Palette::colors, SDL_Color::g, i, SDL_Palette::ncolors, and SDL_Color::r.
Referenced by Map1to1(), SDL_MapRGB(), and SDL_MapRGBA().
void SDL_FreeBlitMap | ( | SDL_BlitMap * | map | ) |
Definition at line 1077 of file SDL_pixels.c.
References SDL_free(), and SDL_InvalidateMap().
Referenced by SDL_FreeSurface().
void 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().
void SDL_FreePalette | ( | SDL_Palette * | palette | ) |
Free a palette created with 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().
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().
Get the RGB components from a pixel of the specified format.
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().
void 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.
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().
int SDL_InitFormat | ( | SDL_PixelFormat * | format, |
Uint32 | pixel_format | ||
) |
Definition at line 519 of file SDL_pixels.c.
References SDL_PixelFormat::Aloss, SDL_PixelFormat::Amask, SDL_PixelFormat::Ashift, SDL_PixelFormat::BitsPerPixel, SDL_PixelFormat::Bloss, SDL_PixelFormat::Bmask, SDL_PixelFormat::Bshift, SDL_PixelFormat::BytesPerPixel, for(), SDL_PixelFormat::format, SDL_PixelFormat::Gloss, SDL_PixelFormat::Gmask, SDL_PixelFormat::Gshift, SDL_PixelFormat::next, NULL, SDL_PixelFormat::palette, SDL_PixelFormat::refcount, SDL_PixelFormat::Rloss, SDL_PixelFormat::Rmask, SDL_PixelFormat::Rshift, SDL_PixelFormatEnumToMasks(), and SDL_zerop.
Referenced by SDL_AllocFormat(), SDL_CreateSurfaceOnStack(), and SDL_SaveBMP_RW().
void SDL_InvalidateMap | ( | SDL_BlitMap * | map | ) |
Definition at line 972 of file SDL_pixels.c.
References SDL_BlitMap::dst, SDL_BlitMap::dst_palette_version, SDL_BlitMap::info, NULL, SDL_Surface::refcount, SDL_free(), SDL_FreeSurface(), SDL_BlitMap::src_palette_version, and SDL_BlitInfo::table.
Referenced by SDL_CalculateBlit(), SDL_ConvertSurface(), SDL_FreeBlitMap(), SDL_MapSurface(), SDL_SetColorKey(), SDL_SetSurfaceAlphaMod(), SDL_SetSurfaceBlendMode(), SDL_SetSurfaceColorMod(), and SDL_SetSurfaceRLE().
Maps an RGB triple to an opaque pixel value for a given pixel format.
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().
Maps an RGBA quadruple to a pixel value for a given pixel format.
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().
int SDL_MapSurface | ( | SDL_Surface * | src, |
SDL_Surface * | dst | ||
) |
Definition at line 991 of file SDL_pixels.c.
References SDL_BlitInfo::a, SDL_BlitInfo::b, SDL_PixelFormat::BitsPerPixel, SDL_BlitMap::dst, SDL_BlitMap::dst_palette_version, SDL_Surface::flags, SDL_Surface::format, SDL_PixelFormat::format, SDL_BlitInfo::g, SDL_BlitMap::identity, SDL_BlitMap::info, SDL_Surface::map, map, Map1to1(), Map1toN(), MapNto1(), NULL, SDL_PixelFormat::palette, SDL_BlitInfo::r, SDL_Surface::refcount, SDL_CalculateBlit(), SDL_InvalidateMap(), SDL_ISPIXELFORMAT_INDEXED, SDL_RLEACCEL, SDL_UnRLESurface(), SDL_BlitMap::src_palette_version, SDL_BlitInfo::table, and SDL_Palette::version.
Referenced by SDL_LowerBlit().
Uint32 SDL_MasksToPixelFormatEnum | ( | int | bpp, |
Uint32 | Rmask, | ||
Uint32 | Gmask, | ||
Uint32 | Bmask, | ||
Uint32 | Amask | ||
) |
Convert a bpp and RGBA masks to an enumerated pixel format.
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().
SDL_bool 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.
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().
int SDL_SetPaletteColors | ( | SDL_Palette * | palette, |
const SDL_Color * | colors, | ||
int | firstcolor, | ||
int | ncolors | ||
) |
Set a range of colors in a palette.
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. |
Definition at line 674 of file SDL_pixels.c.
References SDL_Palette::colors, SDL_Palette::ncolors, SDL_memcpy(), and SDL_Palette::version.
int 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().
|
static |
Definition at line 483 of file SDL_pixels.c.
Referenced by alcOpenDevice(), and SDL_AllocFormat().
|
static |
Definition at line 35 of file SDL_pixels.c.
|
static |
Definition at line 39 of file SDL_pixels.c.
|
static |
Definition at line 43 of file SDL_pixels.c.
|
static |
Definition at line 47 of file SDL_pixels.c.
|
static |
Definition at line 51 of file SDL_pixels.c.
|
static |
Definition at line 55 of file SDL_pixels.c.
|
static |
Definition at line 59 of file SDL_pixels.c.
|
static |
Definition at line 63 of file SDL_pixels.c.
|
static |
Definition at line 67 of file SDL_pixels.c.
Uint8* SDL_expand_byte[9] |
Definition at line 71 of file SDL_pixels.c.
Referenced by SDL_GetRGB(), and SDL_GetRGBA().