Go to the source code of this file.
◆ SDL_AllocBlitMap()
Definition at line 952 of file SDL_pixels.c.
953{
955
956
961 }
966
967
969}
#define SDL_OutOfMemory()
const GLubyte GLuint GLuint GLuint GLuint alpha GLboolean GLboolean GLboolean GLboolean alpha GLint GLint GLsizei GLsizei GLenum type GLenum GLint GLenum GLint GLint GLsizei GLsizei GLint border GLenum GLint GLint GLint GLint GLint GLsizei GLsizei height GLsizei GLsizei GLenum GLenum const GLvoid *pixels GLenum GLint GLint GLint GLint j2 GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLfloat *params GLenum GLint GLenum GLenum GLvoid *pixels GLenum GLint GLenum GLint *params GLenum GLenum GLint *params GLenum GLsizei const GLvoid *pointer GLenum GLenum const GLint *params GLenum GLfloat GLfloat GLint GLint const GLfloat *points GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat *points GLint GLfloat GLfloat GLint GLfloat GLfloat v2 GLenum GLenum const GLint *params GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum map
References map, NULL, SDL_calloc, and SDL_OutOfMemory.
Referenced by SDL_CreateRGBSurfaceWithFormat().
◆ SDL_DitherColors()
Definition at line 742 of file SDL_pixels.c.
743{
745 if (bpp != 8)
746 return;
747
748 for (
i = 0;
i < 256;
i++) {
750
751
753 r |=
r >> 3 |
r >> 6;
756 g |=
g >> 3 |
g >> 6;
763 }
764}
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
References colors, i, and SDL_ALPHA_OPAQUE.
Referenced by MapNto1().
◆ SDL_FindColor()
Definition at line 770 of file SDL_pixels.c.
771{
772
773 unsigned int smallest;
775 int rd, gd, bd, ad;
778
779 smallest = ~0;
785 distance = (rd * rd) + (gd * gd) + (bd * bd) + (ad * ad);
789 break;
790 }
792 }
793 }
794 return (pixel);
795}
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLsizei GLfloat distance
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().
◆ SDL_FreeBlitMap()
◆ SDL_InitFormat()
Definition at line 537 of file SDL_pixels.c.
538{
539 int bpp;
540 Uint32 Rmask, Gmask, Bmask, Amask;
542
544 &Rmask, &Gmask, &Bmask, &Amask)) {
545 return -1;
546 }
547
548
550 format->format = pixel_format;
551 format->BitsPerPixel = bpp;
552 format->BytesPerPixel = (bpp + 7) / 8;
553
557 if (Rmask) {
562 }
563
567 if (Gmask) {
572 }
573
577 if (Bmask) {
582 }
583
587 if (Amask) {
592 }
593
597
598 return 0;
599}
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
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.
References NULL, SDL_PixelFormatEnumToMasks(), and SDL_zerop.
Referenced by SDL_AllocFormat(), SDL_CreateSurfaceOnStack(), and SDL_SaveBMP_RW().
◆ SDL_InvalidateMap()
Definition at line 972 of file SDL_pixels.c.
973{
975 return;
976 }
978
979 if (--
map->dst->refcount <= 0) {
981 }
982 }
984 map->src_palette_version = 0;
985 map->dst_palette_version = 0;
988}
References map, NULL, SDL_free, and SDL_FreeSurface.
Referenced by SDL_CalculateBlit(), SDL_ConvertSurface(), SDL_FreeBlitMap(), SDL_FreeSurface(), SDL_LowerBlitScaled(), SDL_MapSurface(), SDL_SetColorKey(), SDL_SetSurfaceAlphaMod(), SDL_SetSurfaceBlendMode(), SDL_SetSurfaceColorMod(), SDL_SetSurfacePalette(), SDL_SetSurfaceRLE(), and SDL_UpperBlit().
◆ SDL_MapSurface()
Definition at line 991 of file SDL_pixels.c.
992{
996
997
1001 }
1003
1004
1010
1013 if (!
map->identity) {
1014 if (
map->info.table ==
NULL) {
1015 return (-1);
1016 }
1017 }
1020 } else {
1021
1024 src->map->info.b,
src->map->info.a, dstfmt);
1025 if (
map->info.table ==
NULL) {
1026 return (-1);
1027 }
1028 }
1029 } else {
1031
1033 if (!
map->identity) {
1034 if (
map->info.table ==
NULL) {
1035 return (-1);
1036 }
1037 }
1039 } else {
1040
1041 if (srcfmt == dstfmt) {
1043 }
1044 }
1045 }
1046
1048
1050
1051
1052
1053
1054
1055
1056
1057 ++
map->dst->refcount;
1058 }
1059
1062 } else {
1063 map->dst_palette_version = 0;
1064 }
1065
1068 } else {
1069 map->src_palette_version = 0;
1070 }
1071
1072
1074}
void SDL_UnRLESurface(SDL_Surface *surface, int recode)
int SDL_CalculateBlit(SDL_Surface *surface)
static Uint8 * MapNto1(SDL_PixelFormat *src, SDL_PixelFormat *dst, int *identical)
static Uint8 * Map1toN(SDL_PixelFormat *src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod, SDL_PixelFormat *dst)
static Uint8 * Map1to1(SDL_Palette *src, SDL_Palette *dst, int *identical)
#define SDL_ISPIXELFORMAT_INDEXED(format)
References SDL_PixelFormat::BitsPerPixel, SDL_PixelFormat::format, map, Map1to1(), Map1toN(), MapNto1(), NULL, SDL_PixelFormat::palette, SDL_CalculateBlit(), SDL_InvalidateMap(), SDL_ISPIXELFORMAT_INDEXED, SDL_RLEACCEL, SDL_UnRLESurface(), and SDL_Palette::version.
Referenced by SDL_LowerBlit().