SDL  2.0
SDL_blit.h File Reference
#include "../SDL_internal.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_surface.h"
+ Include dependency graph for SDL_blit.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SDL_BlitInfo
 
struct  SDL_BlitFuncEntry
 
struct  SDL_BlitMap
 

Macros

#define SDL_COPY_MODULATE_COLOR   0x00000001
 
#define SDL_COPY_MODULATE_ALPHA   0x00000002
 
#define SDL_COPY_BLEND   0x00000010
 
#define SDL_COPY_ADD   0x00000020
 
#define SDL_COPY_MOD   0x00000040
 
#define SDL_COPY_COLORKEY   0x00000100
 
#define SDL_COPY_NEAREST   0x00000200
 
#define SDL_COPY_RLE_DESIRED   0x00001000
 
#define SDL_COPY_RLE_COLORKEY   0x00002000
 
#define SDL_COPY_RLE_ALPHAKEY   0x00004000
 
#define SDL_COPY_RLE_MASK   (SDL_COPY_RLE_DESIRED|SDL_COPY_RLE_COLORKEY|SDL_COPY_RLE_ALPHAKEY)
 
#define SDL_CPU_ANY   0x00000000
 
#define SDL_CPU_MMX   0x00000001
 
#define SDL_CPU_3DNOW   0x00000002
 
#define SDL_CPU_SSE   0x00000004
 
#define SDL_CPU_SSE2   0x00000008
 
#define SDL_CPU_ALTIVEC_PREFETCH   0x00000010
 
#define SDL_CPU_ALTIVEC_NOPREFETCH   0x00000020
 
#define DECLARE_ALIGNED(t, v, a)   t v
 
#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b)
 
#define RGB_FROM_RGB565(Pixel, r, g, b)
 
#define RGB_FROM_RGB555(Pixel, r, g, b)
 
#define RGB_FROM_RGB888(Pixel, r, g, b)
 
#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel)
 
#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b)
 
#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)
 
#define RGB565_FROM_RGB(Pixel, r, g, b)
 
#define RGB555_FROM_RGB(Pixel, r, g, b)
 
#define RGB888_FROM_RGB(Pixel, r, g, b)
 
#define ARGB8888_FROM_RGBA(Pixel, r, g, b, a)
 
#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a)
 
#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a)
 
#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a)
 
#define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a)
 
#define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b)
 
#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a)
 
#define RGBA_FROM_8888(Pixel, fmt, r, g, b, a)
 
#define RGBA_FROM_RGBA8888(Pixel, r, g, b, a)
 
#define RGBA_FROM_ARGB8888(Pixel, r, g, b, a)
 
#define RGBA_FROM_ABGR8888(Pixel, r, g, b, a)
 
#define RGBA_FROM_BGRA8888(Pixel, r, g, b, a)
 
#define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a)
 
#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)
 
#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)
 
#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)
 
#define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB)
 
#define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA)
 
#define USE_DUFFS_LOOP
 
#define DUFFS_LOOP8(pixel_copy_increment, width)
 
#define DUFFS_LOOP4(pixel_copy_increment, width)
 
#define DUFFS_LOOP(pixel_copy_increment, width)   DUFFS_LOOP8(pixel_copy_increment, width)
 
#define DUFFS_LOOP_124(pixel_copy_increment1, pixel_copy_increment2, pixel_copy_increment4, width)
 

Typedefs

typedef void(* SDL_BlitFunc) (SDL_BlitInfo *info)
 

Functions

int SDL_CalculateBlit (SDL_Surface *surface)
 
SDL_BlitFunc SDL_CalculateBlit0 (SDL_Surface *surface)
 
SDL_BlitFunc SDL_CalculateBlit1 (SDL_Surface *surface)
 
SDL_BlitFunc SDL_CalculateBlitN (SDL_Surface *surface)
 
SDL_BlitFunc SDL_CalculateBlitA (SDL_Surface *surface)
 

Variables

Uint8SDL_expand_byte [9]
 

Macro Definition Documentation

◆ ABGR8888_FROM_RGBA

#define ABGR8888_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = (a<<24)|(b<<16)|(g<<8)|r; \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean GLboolean GLboolean a
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 245 of file SDL_blit.h.

◆ ALPHA_BLEND_RGB

#define ALPHA_BLEND_RGB (   sR,
  sG,
  sB,
  A,
  dR,
  dG,
  dB 
)
Value:
do { \
dR = (Uint8)((((int)(sR-dR)*(int)A)/255)+dR); \
dG = (Uint8)((((int)(sG-dG)*(int)A)/255)+dG); \
dB = (Uint8)((((int)(sB-dB)*(int)A)/255)+dB); \
} while(0)
uint8_t Uint8
Definition: SDL_stdinc.h:179

Definition at line 445 of file SDL_blit.h.

Referenced by BlitNto1PixelAlpha(), BlitNto1SurfaceAlpha(), and BlitNto1SurfaceAlphaKey().

◆ ALPHA_BLEND_RGBA

#define ALPHA_BLEND_RGBA (   sR,
  sG,
  sB,
  sA,
  dR,
  dG,
  dB,
  dA 
)
Value:
do { \
dR = (Uint8)((((int)(sR-dR)*(int)sA)/255)+dR); \
dG = (Uint8)((((int)(sG-dG)*(int)sA)/255)+dG); \
dB = (Uint8)((((int)(sB-dB)*(int)sA)/255)+dB); \
dA = (Uint8)((int)sA+dA-((int)sA*dA)/255); \
} while(0)
uint8_t Uint8
Definition: SDL_stdinc.h:179

Definition at line 454 of file SDL_blit.h.

Referenced by Blit1toNAlpha(), Blit1toNAlphaKey(), BlitBtoNAlpha(), BlitBtoNAlphaKey(), BlitNtoNPixelAlpha(), BlitNtoNSurfaceAlpha(), and BlitNtoNSurfaceAlphaKey().

◆ ARGB2101010_FROM_RGBA

#define ARGB2101010_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = r ? ((r << 2) | 0x3) : 0; \
g = g ? ((g << 2) | 0x3) : 0; \
b = b ? ((b << 2) | 0x3) : 0; \
a = (a * 3) / 255; \
Pixel = (a<<30)|(r<<20)|(g<<10)|b; \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean GLboolean GLboolean a
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 253 of file SDL_blit.h.

Referenced by BlitNto2101010().

◆ ARGB8888_FROM_RGBA

#define ARGB8888_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = (a<<24)|(r<<16)|(g<<8)|b; \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean GLboolean GLboolean a
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 237 of file SDL_blit.h.

◆ ASSEMBLE_RGB

#define ASSEMBLE_RGB (   buf,
  bpp,
  fmt,
  r,
  g,
  b 
)

Definition at line 261 of file SDL_blit.h.

Referenced by SDL_Blit_Slow().

◆ ASSEMBLE_RGBA

◆ BGRA8888_FROM_RGBA

#define BGRA8888_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = (b<<24)|(g<<16)|(r<<8)|a; \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean GLboolean GLboolean a
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 249 of file SDL_blit.h.

◆ DECLARE_ALIGNED

#define DECLARE_ALIGNED (   t,
  v,
  a 
)    t v

Definition at line 118 of file SDL_blit.h.

◆ DISEMBLE_RGB

#define DISEMBLE_RGB (   buf,
  bpp,
  fmt,
  Pixel,
  r,
  g,
  b 
)

◆ DISEMBLE_RGBA

◆ DUFFS_LOOP

◆ DUFFS_LOOP4

#define DUFFS_LOOP4 (   pixel_copy_increment,
  width 
)
Value:
{ int n = (width+3)/4; \
switch (width & 3) { \
case 0: do { pixel_copy_increment; /* fallthrough */ \
case 3: pixel_copy_increment; /* fallthrough */ \
case 2: pixel_copy_increment; /* fallthrough */ \
case 1: pixel_copy_increment; /* fallthrough */ \
} while (--n > 0); \
} \
}
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
GLdouble n

Definition at line 488 of file SDL_blit.h.

Referenced by Blit1toNAlpha(), Blit555to555SurfaceAlpha(), Blit565to565SurfaceAlpha(), BlitARGBto555PixelAlpha(), BlitARGBto565PixelAlpha(), BlitNto1PixelAlpha(), BlitNto1SurfaceAlpha(), BlitNto1SurfaceAlphaKey(), BlitNtoNPixelAlpha(), BlitNtoNSurfaceAlpha(), BlitNtoNSurfaceAlphaKey(), BlitRGBtoRGBPixelAlpha(), BlitRGBtoRGBSurfaceAlpha(), and BlitRGBtoRGBSurfaceAlpha128().

◆ DUFFS_LOOP8

#define DUFFS_LOOP8 (   pixel_copy_increment,
  width 
)
Value:
{ int n = (width+7)/8; \
switch (width & 7) { \
case 0: do { pixel_copy_increment; /* fallthrough */ \
case 7: pixel_copy_increment; /* fallthrough */ \
case 6: pixel_copy_increment; /* fallthrough */ \
case 5: pixel_copy_increment; /* fallthrough */ \
case 4: pixel_copy_increment; /* fallthrough */ \
case 3: pixel_copy_increment; /* fallthrough */ \
case 2: pixel_copy_increment; /* fallthrough */ \
case 1: pixel_copy_increment; /* fallthrough */ \
} while ( --n > 0 ); \
} \
}
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
GLdouble n

Definition at line 472 of file SDL_blit.h.

◆ DUFFS_LOOP_124

#define DUFFS_LOOP_124 (   pixel_copy_increment1,
  pixel_copy_increment2,
  pixel_copy_increment4,
  width 
)
Value:
{ int n = width; \
if (n & 1) { \
pixel_copy_increment1; n -= 1; \
} \
if (n & 2) { \
pixel_copy_increment2; n -= 2; \
} \
if (n & 4) { \
pixel_copy_increment4; n -= 4; \
} \
if (n) { \
n /= 8; \
do { \
pixel_copy_increment4; \
pixel_copy_increment4; \
} while (--n > 0); \
} \
}
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
GLdouble n

Definition at line 504 of file SDL_blit.h.

Referenced by Blit16to16SurfaceAlpha128().

◆ PIXEL_FROM_RGB

#define PIXEL_FROM_RGB (   Pixel,
  fmt,
  r,
  g,
  b 
)
Value:
{ \
Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
((g>>fmt->Gloss)<<fmt->Gshift)| \
((b>>fmt->Bloss)<<fmt->Bshift)| \
fmt->Amask; \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 218 of file SDL_blit.h.

Referenced by copy_opaque_16(), copy_transl_555(), and copy_transl_565().

◆ PIXEL_FROM_RGBA

#define PIXEL_FROM_RGBA (   Pixel,
  fmt,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
((g>>fmt->Gloss)<<fmt->Gshift)| \
((b>>fmt->Bloss)<<fmt->Bshift)| \
((a>>fmt->Aloss)<<fmt->Ashift); \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean GLboolean GLboolean a
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 395 of file SDL_blit.h.

Referenced by uncopy_32(), uncopy_opaque_16(), and uncopy_transl_16().

◆ RETRIEVE_RGB_PIXEL

#define RETRIEVE_RGB_PIXEL (   buf,
  bpp,
  Pixel 
)
Value:
do { \
switch (bpp) { \
case 1: \
Pixel = *((Uint8 *)(buf)); \
break; \
\
case 2: \
Pixel = *((Uint16 *)(buf)); \
break; \
\
case 3: { \
Uint8 *B = (Uint8 *)(buf); \
Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \
} else { \
Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \
} \
} \
break; \
\
case 4: \
Pixel = *((Uint32 *)(buf)); \
break; \
\
default: \
Pixel = 0; /* stop gcc complaints */ \
break; \
} \
} while (0)
uint16_t Uint16
Definition: SDL_stdinc.h:191
#define SDL_LIL_ENDIAN
Definition: SDL_endian.h:37
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp
uint8_t Uint8
Definition: SDL_stdinc.h:179
GLenum GLuint GLenum GLsizei const GLchar * buf
uint32_t Uint32
Definition: SDL_stdinc.h:203
#define SDL_BYTEORDER

Definition at line 146 of file SDL_blit.h.

Referenced by BlitNtoNKey(), and BlitNtoNSurfaceAlphaKey().

◆ RGB555_FROM_RGB

#define RGB555_FROM_RGB (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3); \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 229 of file SDL_blit.h.

◆ RGB565_FROM_RGB

#define RGB565_FROM_RGB (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 225 of file SDL_blit.h.

◆ RGB888_FROM_RGB

#define RGB888_FROM_RGB (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
Pixel = (r<<16)|(g<<8)|b; \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 233 of file SDL_blit.h.

◆ RGB_FROM_PIXEL

#define RGB_FROM_PIXEL (   Pixel,
  fmt,
  r,
  g,
  b 
)
Value:
{ \
r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \
g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \
b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \
}
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71

Definition at line 122 of file SDL_blit.h.

Referenced by BlitNtoNKey(), BlitNtoNSurfaceAlphaKey(), copy_opaque_16(), uncopy_32(), uncopy_opaque_16(), and uncopy_transl_16().

◆ RGB_FROM_RGB555

#define RGB_FROM_RGB555 (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
r = SDL_expand_byte[3][((Pixel&0x7C00)>>10)]; \
g = SDL_expand_byte[3][((Pixel&0x03E0)>>5)]; \
b = SDL_expand_byte[3][(Pixel&0x001F)]; \
}
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71

Definition at line 134 of file SDL_blit.h.

◆ RGB_FROM_RGB565

#define RGB_FROM_RGB565 (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
r = SDL_expand_byte[3][((Pixel&0xF800)>>11)]; \
g = SDL_expand_byte[2][((Pixel&0x07E0)>>5)]; \
b = SDL_expand_byte[3][(Pixel&0x001F)]; \
}
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71

Definition at line 128 of file SDL_blit.h.

◆ RGB_FROM_RGB888

#define RGB_FROM_RGB888 (   Pixel,
  r,
  g,
  b 
)
Value:
{ \
r = ((Pixel&0xFF0000)>>16); \
g = ((Pixel&0xFF00)>>8); \
b = (Pixel&0xFF); \
}

Definition at line 140 of file SDL_blit.h.

◆ RGBA8888_FROM_RGBA

#define RGBA8888_FROM_RGBA (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
Pixel = (r<<24)|(g<<16)|(b<<8)|a; \
}
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
GLboolean GLboolean GLboolean GLboolean a
GLboolean GLboolean g
GLboolean GLboolean GLboolean b

Definition at line 241 of file SDL_blit.h.

◆ RGBA_FROM_8888

#define RGBA_FROM_8888 (   Pixel,
  fmt,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = (Pixel&fmt->Rmask)>>fmt->Rshift; \
g = (Pixel&fmt->Gmask)>>fmt->Gshift; \
b = (Pixel&fmt->Bmask)>>fmt->Bshift; \
a = (Pixel&fmt->Amask)>>fmt->Ashift; \
}
GLboolean GLboolean GLboolean GLboolean a
GLboolean GLboolean g

Definition at line 311 of file SDL_blit.h.

Referenced by copy_32(), copy_transl_555(), and copy_transl_565().

◆ RGBA_FROM_ABGR8888

#define RGBA_FROM_ABGR8888 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = (Pixel&0xFF); \
g = ((Pixel>>8)&0xFF); \
b = ((Pixel>>16)&0xFF); \
a = (Pixel>>24); \
}

Definition at line 332 of file SDL_blit.h.

◆ RGBA_FROM_ARGB2101010

#define RGBA_FROM_ARGB2101010 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = ((Pixel>>22)&0xFF); \
g = ((Pixel>>12)&0xFF); \
b = ((Pixel>>2)&0xFF); \
a = SDL_expand_byte[6][(Pixel>>30)]; \
}
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71

Definition at line 346 of file SDL_blit.h.

Referenced by Blit2101010toN().

◆ RGBA_FROM_ARGB8888

#define RGBA_FROM_ARGB8888 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = ((Pixel>>16)&0xFF); \
g = ((Pixel>>8)&0xFF); \
b = (Pixel&0xFF); \
a = (Pixel>>24); \
}

Definition at line 325 of file SDL_blit.h.

◆ RGBA_FROM_BGRA8888

#define RGBA_FROM_BGRA8888 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = ((Pixel>>8)&0xFF); \
g = ((Pixel>>16)&0xFF); \
b = (Pixel>>24); \
a = (Pixel&0xFF); \
}

Definition at line 339 of file SDL_blit.h.

◆ RGBA_FROM_PIXEL

#define RGBA_FROM_PIXEL (   Pixel,
  fmt,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \
g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \
b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \
a = SDL_expand_byte[fmt->Aloss][((Pixel&fmt->Amask)>>fmt->Ashift)]; \
}
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71

Definition at line 304 of file SDL_blit.h.

◆ RGBA_FROM_RGBA8888

#define RGBA_FROM_RGBA8888 (   Pixel,
  r,
  g,
  b,
  a 
)
Value:
{ \
r = (Pixel>>24); \
g = ((Pixel>>16)&0xFF); \
b = ((Pixel>>8)&0xFF); \
a = (Pixel&0xFF); \
}

Definition at line 318 of file SDL_blit.h.

◆ SDL_COPY_ADD

#define SDL_COPY_ADD   0x00000020

Definition at line 37 of file SDL_blit.h.

Referenced by SDL_Blit_ABGR8888_ARGB8888_Blend(), SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_BGR888_Blend(), SDL_Blit_ABGR8888_BGR888_Blend_Scale(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_RGB888_Blend(), SDL_Blit_ABGR8888_RGB888_Blend_Scale(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_ARGB8888_Blend(), SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_BGR888_Blend(), SDL_Blit_ARGB8888_BGR888_Blend_Scale(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_RGB888_Blend(), SDL_Blit_ARGB8888_RGB888_Blend_Scale(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGR888_ARGB8888_Blend(), SDL_Blit_BGR888_ARGB8888_Blend_Scale(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGR888_BGR888_Blend(), SDL_Blit_BGR888_BGR888_Blend_Scale(), SDL_Blit_BGR888_BGR888_Modulate_Blend(), SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGR888_RGB888_Blend(), SDL_Blit_BGR888_RGB888_Blend_Scale(), SDL_Blit_BGR888_RGB888_Modulate_Blend(), SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_ARGB8888_Blend(), SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_BGR888_Blend(), SDL_Blit_BGRA8888_BGR888_Blend_Scale(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_RGB888_Blend(), SDL_Blit_BGRA8888_RGB888_Blend_Scale(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGB888_ARGB8888_Blend(), SDL_Blit_RGB888_ARGB8888_Blend_Scale(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGB888_BGR888_Blend(), SDL_Blit_RGB888_BGR888_Blend_Scale(), SDL_Blit_RGB888_BGR888_Modulate_Blend(), SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGB888_RGB888_Blend(), SDL_Blit_RGB888_RGB888_Blend_Scale(), SDL_Blit_RGB888_RGB888_Modulate_Blend(), SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_ARGB8888_Blend(), SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_BGR888_Blend(), SDL_Blit_RGBA8888_BGR888_Blend_Scale(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_RGB888_Blend(), SDL_Blit_RGBA8888_RGB888_Blend_Scale(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_Slow(), SDL_ChooseBlitFunc(), SDL_GetSurfaceBlendMode(), SDL_LowerBlitScaled(), SDL_RLESurface(), and SDL_SetSurfaceBlendMode().

◆ SDL_COPY_BLEND

#define SDL_COPY_BLEND   0x00000010

Definition at line 36 of file SDL_blit.h.

Referenced by SDL_Blit_ABGR8888_ARGB8888_Blend(), SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_BGR888_Blend(), SDL_Blit_ABGR8888_BGR888_Blend_Scale(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_RGB888_Blend(), SDL_Blit_ABGR8888_RGB888_Blend_Scale(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_ARGB8888_Blend(), SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_BGR888_Blend(), SDL_Blit_ARGB8888_BGR888_Blend_Scale(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_RGB888_Blend(), SDL_Blit_ARGB8888_RGB888_Blend_Scale(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGR888_ARGB8888_Blend(), SDL_Blit_BGR888_ARGB8888_Blend_Scale(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGR888_BGR888_Blend(), SDL_Blit_BGR888_BGR888_Blend_Scale(), SDL_Blit_BGR888_BGR888_Modulate_Blend(), SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGR888_RGB888_Blend(), SDL_Blit_BGR888_RGB888_Blend_Scale(), SDL_Blit_BGR888_RGB888_Modulate_Blend(), SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_ARGB8888_Blend(), SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_BGR888_Blend(), SDL_Blit_BGRA8888_BGR888_Blend_Scale(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_RGB888_Blend(), SDL_Blit_BGRA8888_RGB888_Blend_Scale(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGB888_ARGB8888_Blend(), SDL_Blit_RGB888_ARGB8888_Blend_Scale(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGB888_BGR888_Blend(), SDL_Blit_RGB888_BGR888_Blend_Scale(), SDL_Blit_RGB888_BGR888_Modulate_Blend(), SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGB888_RGB888_Blend(), SDL_Blit_RGB888_RGB888_Blend_Scale(), SDL_Blit_RGB888_RGB888_Modulate_Blend(), SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_ARGB8888_Blend(), SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_BGR888_Blend(), SDL_Blit_RGBA8888_BGR888_Blend_Scale(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_RGB888_Blend(), SDL_Blit_RGBA8888_RGB888_Blend_Scale(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_Slow(), SDL_CalculateBlit(), SDL_CalculateBlit0(), SDL_CalculateBlit1(), SDL_CalculateBlitA(), SDL_ChooseBlitFunc(), SDL_ConvertSurface(), SDL_GetSurfaceBlendMode(), SDL_LowerBlitScaled(), SDL_RLESurface(), and SDL_SetSurfaceBlendMode().

◆ SDL_COPY_COLORKEY

◆ SDL_COPY_MOD

#define SDL_COPY_MOD   0x00000040

Definition at line 38 of file SDL_blit.h.

Referenced by SDL_Blit_ABGR8888_ARGB8888_Blend(), SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_BGR888_Blend(), SDL_Blit_ABGR8888_BGR888_Blend_Scale(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_RGB888_Blend(), SDL_Blit_ABGR8888_RGB888_Blend_Scale(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_ARGB8888_Blend(), SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_BGR888_Blend(), SDL_Blit_ARGB8888_BGR888_Blend_Scale(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_RGB888_Blend(), SDL_Blit_ARGB8888_RGB888_Blend_Scale(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGR888_ARGB8888_Blend(), SDL_Blit_BGR888_ARGB8888_Blend_Scale(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGR888_BGR888_Blend(), SDL_Blit_BGR888_BGR888_Blend_Scale(), SDL_Blit_BGR888_BGR888_Modulate_Blend(), SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGR888_RGB888_Blend(), SDL_Blit_BGR888_RGB888_Blend_Scale(), SDL_Blit_BGR888_RGB888_Modulate_Blend(), SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_ARGB8888_Blend(), SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_BGR888_Blend(), SDL_Blit_BGRA8888_BGR888_Blend_Scale(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_RGB888_Blend(), SDL_Blit_BGRA8888_RGB888_Blend_Scale(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGB888_ARGB8888_Blend(), SDL_Blit_RGB888_ARGB8888_Blend_Scale(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGB888_BGR888_Blend(), SDL_Blit_RGB888_BGR888_Blend_Scale(), SDL_Blit_RGB888_BGR888_Modulate_Blend(), SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGB888_RGB888_Blend(), SDL_Blit_RGB888_RGB888_Blend_Scale(), SDL_Blit_RGB888_RGB888_Modulate_Blend(), SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_ARGB8888_Blend(), SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_BGR888_Blend(), SDL_Blit_RGBA8888_BGR888_Blend_Scale(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_RGB888_Blend(), SDL_Blit_RGBA8888_RGB888_Blend_Scale(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_Slow(), SDL_ChooseBlitFunc(), SDL_GetSurfaceBlendMode(), SDL_LowerBlitScaled(), SDL_RLESurface(), and SDL_SetSurfaceBlendMode().

◆ SDL_COPY_MODULATE_ALPHA

#define SDL_COPY_MODULATE_ALPHA   0x00000002

Definition at line 35 of file SDL_blit.h.

Referenced by SDL_Blit_ABGR8888_ARGB8888_Modulate(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_ARGB8888_Modulate(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGR888_ARGB8888_Modulate(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGR888_ARGB8888_Modulate_Scale(), SDL_Blit_BGR888_BGR888_Modulate_Blend(), SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGR888_RGB888_Modulate_Blend(), SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_ARGB8888_Modulate(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGB888_ARGB8888_Modulate(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGB888_ARGB8888_Modulate_Scale(), SDL_Blit_RGB888_BGR888_Modulate_Blend(), SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGB888_RGB888_Modulate_Blend(), SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_ARGB8888_Modulate(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_Slow(), SDL_CalculateBlit0(), SDL_CalculateBlit1(), SDL_CalculateBlitA(), SDL_ChooseBlitFunc(), SDL_ConvertSurface(), SDL_LowerBlitScaled(), SDL_RLESurface(), and SDL_SetSurfaceAlphaMod().

◆ SDL_COPY_MODULATE_COLOR

#define SDL_COPY_MODULATE_COLOR   0x00000001

Definition at line 34 of file SDL_blit.h.

Referenced by SDL_Blit_ABGR8888_ARGB8888_Modulate(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(), SDL_Blit_ABGR8888_BGR888_Modulate(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend(), SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_BGR888_Modulate_Scale(), SDL_Blit_ABGR8888_RGB888_Modulate(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend(), SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_ABGR8888_RGB888_Modulate_Scale(), SDL_Blit_ARGB8888_ARGB8888_Modulate(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(), SDL_Blit_ARGB8888_BGR888_Modulate(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend(), SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_BGR888_Modulate_Scale(), SDL_Blit_ARGB8888_RGB888_Modulate(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend(), SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_ARGB8888_RGB888_Modulate_Scale(), SDL_Blit_BGR888_ARGB8888_Modulate(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend(), SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGR888_ARGB8888_Modulate_Scale(), SDL_Blit_BGR888_BGR888_Modulate(), SDL_Blit_BGR888_BGR888_Modulate_Blend(), SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGR888_BGR888_Modulate_Scale(), SDL_Blit_BGR888_RGB888_Modulate(), SDL_Blit_BGR888_RGB888_Modulate_Blend(), SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGR888_RGB888_Modulate_Scale(), SDL_Blit_BGRA8888_ARGB8888_Modulate(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(), SDL_Blit_BGRA8888_BGR888_Modulate(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend(), SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_BGR888_Modulate_Scale(), SDL_Blit_BGRA8888_RGB888_Modulate(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend(), SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_BGRA8888_RGB888_Modulate_Scale(), SDL_Blit_RGB888_ARGB8888_Modulate(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend(), SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGB888_ARGB8888_Modulate_Scale(), SDL_Blit_RGB888_BGR888_Modulate(), SDL_Blit_RGB888_BGR888_Modulate_Blend(), SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGB888_BGR888_Modulate_Scale(), SDL_Blit_RGB888_RGB888_Modulate(), SDL_Blit_RGB888_RGB888_Modulate_Blend(), SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGB888_RGB888_Modulate_Scale(), SDL_Blit_RGBA8888_ARGB8888_Modulate(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(), SDL_Blit_RGBA8888_BGR888_Modulate(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend(), SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_BGR888_Modulate_Scale(), SDL_Blit_RGBA8888_RGB888_Modulate(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend(), SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(), SDL_Blit_RGBA8888_RGB888_Modulate_Scale(), SDL_Blit_Slow(), SDL_ChooseBlitFunc(), SDL_LowerBlitScaled(), SDL_RLESurface(), and SDL_SetSurfaceColorMod().

◆ SDL_COPY_NEAREST

#define SDL_COPY_NEAREST   0x00000200

Definition at line 40 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc(), SDL_LowerBlitScaled(), SDL_RLESurface(), and SDL_UpperBlit().

◆ SDL_COPY_RLE_ALPHAKEY

#define SDL_COPY_RLE_ALPHAKEY   0x00004000

Definition at line 43 of file SDL_blit.h.

Referenced by SDL_ConvertSurface(), SDL_RLESurface(), and SDL_UnRLESurface().

◆ SDL_COPY_RLE_COLORKEY

#define SDL_COPY_RLE_COLORKEY   0x00002000

Definition at line 42 of file SDL_blit.h.

Referenced by SDL_ConvertSurface(), SDL_RLESurface(), and SDL_UnRLESurface().

◆ SDL_COPY_RLE_DESIRED

#define SDL_COPY_RLE_DESIRED   0x00001000

Definition at line 41 of file SDL_blit.h.

Referenced by SDL_CalculateBlit(), SDL_ConvertSurface(), and SDL_SetSurfaceRLE().

◆ SDL_COPY_RLE_MASK

◆ SDL_CPU_3DNOW

#define SDL_CPU_3DNOW   0x00000002

Definition at line 49 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

◆ SDL_CPU_ALTIVEC_NOPREFETCH

#define SDL_CPU_ALTIVEC_NOPREFETCH   0x00000020

Definition at line 53 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

◆ SDL_CPU_ALTIVEC_PREFETCH

#define SDL_CPU_ALTIVEC_PREFETCH   0x00000010

Definition at line 52 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

◆ SDL_CPU_ANY

#define SDL_CPU_ANY   0x00000000

Definition at line 47 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

◆ SDL_CPU_MMX

#define SDL_CPU_MMX   0x00000001

Definition at line 48 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

◆ SDL_CPU_SSE

#define SDL_CPU_SSE   0x00000004

Definition at line 50 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

◆ SDL_CPU_SSE2

#define SDL_CPU_SSE2   0x00000008

Definition at line 51 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

◆ USE_DUFFS_LOOP

#define USE_DUFFS_LOOP

Definition at line 467 of file SDL_blit.h.

Referenced by Blit1to2().

Typedef Documentation

◆ SDL_BlitFunc

typedef void(* SDL_BlitFunc) (SDL_BlitInfo *info)

Definition at line 73 of file SDL_blit.h.

Function Documentation

◆ SDL_CalculateBlit()

int SDL_CalculateBlit ( SDL_Surface surface)

Definition at line 216 of file SDL_blit.c.

References SDL_PixelFormat::BitsPerPixel, SDL_BlitMap::blit, SDL_PixelFormat::BytesPerPixel, SDL_BlitMap::data, SDL_BlitMap::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_pitch, SDL_BlitInfo::flags, SDL_Surface::flags, SDL_Surface::format, SDL_PixelFormat::format, SDL_BlitMap::identity, SDL_BlitMap::info, SDL_Surface::map, map, NULL, SDL_Surface::pitch, SDL_PixelFormat::Rloss, SDL_Blit_Slow(), SDL_BlitCopy(), SDL_CalculateBlit0(), SDL_CalculateBlit1(), SDL_CalculateBlitA(), SDL_CalculateBlitN(), SDL_ChooseBlitFunc(), SDL_COPY_BLEND, SDL_COPY_RLE_DESIRED, SDL_GeneratedBlitFuncTable, SDL_InvalidateMap(), SDL_ISPIXELFORMAT_FOURCC, SDL_ISPIXELFORMAT_INDEXED, SDL_RLEACCEL, SDL_RLESurface(), SDL_SetError, SDL_SoftBlit(), SDL_UnRLESurface(), SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_pitch.

Referenced by SDL_MapSurface().

217 {
218  SDL_BlitFunc blit = NULL;
219  SDL_BlitMap *map = surface->map;
220  SDL_Surface *dst = map->dst;
221 
222  /* We don't currently support blitting to < 8 bpp surfaces */
223  if (dst->format->BitsPerPixel < 8) {
224  SDL_InvalidateMap(map);
225  return SDL_SetError("Blit combination not supported");
226  }
227 
228  /* Clean everything out to start */
229  if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) {
230  SDL_UnRLESurface(surface, 1);
231  }
232  map->blit = SDL_SoftBlit;
233  map->info.src_fmt = surface->format;
234  map->info.src_pitch = surface->pitch;
235  map->info.dst_fmt = dst->format;
236  map->info.dst_pitch = dst->pitch;
237 
238  /* See if we can do RLE acceleration */
239  if (map->info.flags & SDL_COPY_RLE_DESIRED) {
240  if (SDL_RLESurface(surface) == 0) {
241  return 0;
242  }
243  }
244 
245  /* Choose a standard blit function */
246  if (map->identity && !(map->info.flags & ~SDL_COPY_RLE_DESIRED)) {
247  blit = SDL_BlitCopy;
248  } else if (surface->format->Rloss > 8 || dst->format->Rloss > 8) {
249  /* Greater than 8 bits per channel not supported yet */
250  SDL_InvalidateMap(map);
251  return SDL_SetError("Blit combination not supported");
252  } else if (surface->format->BitsPerPixel < 8 &&
254  blit = SDL_CalculateBlit0(surface);
255  } else if (surface->format->BytesPerPixel == 1 &&
257  blit = SDL_CalculateBlit1(surface);
258  } else if (map->info.flags & SDL_COPY_BLEND) {
259  blit = SDL_CalculateBlitA(surface);
260  } else {
261  blit = SDL_CalculateBlitN(surface);
262  }
263  if (blit == NULL) {
264  Uint32 src_format = surface->format->format;
265  Uint32 dst_format = dst->format->format;
266 
267  blit =
268  SDL_ChooseBlitFunc(src_format, dst_format, map->info.flags,
270  }
271 #ifndef TEST_SLOW_BLIT
272  if (blit == NULL)
273 #endif
274  {
275  Uint32 src_format = surface->format->format;
276  Uint32 dst_format = dst->format->format;
277 
278  if (!SDL_ISPIXELFORMAT_INDEXED(src_format) &&
279  !SDL_ISPIXELFORMAT_FOURCC(src_format) &&
280  !SDL_ISPIXELFORMAT_INDEXED(dst_format) &&
281  !SDL_ISPIXELFORMAT_FOURCC(dst_format)) {
282  blit = SDL_Blit_Slow;
283  }
284  }
285  map->data = blit;
286 
287  /* Make sure we have a blit function */
288  if (blit == NULL) {
289  SDL_InvalidateMap(map);
290  return SDL_SetError("Blit combination not supported");
291  }
292 
293  return 0;
294 }
SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface)
Definition: SDL_blit_N.c:2638
SDL_blit blit
Definition: SDL_blit.h:90
GLenum GLenum dst
#define SDL_ISPIXELFORMAT_INDEXED(format)
Definition: SDL_pixels.h:134
Uint8 BytesPerPixel
Definition: SDL_pixels.h:320
SDL_PixelFormat * src_fmt
Definition: SDL_blit.h:65
void SDL_Blit_Slow(SDL_BlitInfo *info)
Definition: SDL_blit_slow.c:31
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
void SDL_UnRLESurface(SDL_Surface *surface, int recode)
int dst_pitch
Definition: SDL_blit.h:63
Uint32 flags
Definition: SDL_surface.h:71
#define SDL_COPY_RLE_DESIRED
Definition: SDL_blit.h:41
void SDL_InvalidateMap(SDL_BlitMap *map)
Definition: SDL_pixels.c:972
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
void SDL_BlitCopy(SDL_BlitInfo *info)
Definition: SDL_blit_copy.c:91
static SDL_BlitFunc SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags, SDL_BlitFuncEntry *entries)
Definition: SDL_blit.c:128
Uint8 BitsPerPixel
Definition: SDL_pixels.h:319
SDL_PixelFormat * dst_fmt
Definition: SDL_blit.h:66
SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[]
int src_pitch
Definition: SDL_blit.h:59
int SDL_RLESurface(SDL_Surface *surface)
SDL_Surface * dst
Definition: SDL_blit.h:88
#define NULL
Definition: begin_code.h:164
SDL_PixelFormat * format
Definition: SDL_surface.h:72
SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface)
Definition: SDL_blit_0.c:454
#define SDL_SetError
SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface *surface)
Definition: SDL_blit_1.c:522
uint32_t Uint32
Definition: SDL_stdinc.h:203
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:73
static int SDL_SoftBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
Definition: SDL_blit.c:34
void * data
Definition: SDL_blit.h:91
#define SDL_ISPIXELFORMAT_FOURCC(format)
Definition: SDL_pixels.h:167
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
Definition: SDL_glfuncs.h:290
SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface)
Definition: SDL_blit_A.c:1333
int identity
Definition: SDL_blit.h:89
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_BlitInfo info
Definition: SDL_blit.h:92
#define SDL_RLEACCEL
Definition: SDL_surface.h:54

◆ SDL_CalculateBlit0()

SDL_BlitFunc SDL_CalculateBlit0 ( SDL_Surface surface)

Definition at line 454 of file SDL_blit_0.c.

References bitmap_blit, SDL_PixelFormat::BitsPerPixel, BlitBtoNAlpha(), BlitBtoNAlphaKey(), SDL_PixelFormat::BytesPerPixel, colorkey_blit, SDL_BlitMap::dst, SDL_BlitInfo::flags, SDL_Surface::format, SDL_BlitMap::info, SDL_Surface::map, NULL, SDL_COPY_BLEND, SDL_COPY_COLORKEY, SDL_COPY_MODULATE_ALPHA, and SDL_COPY_RLE_MASK.

Referenced by SDL_CalculateBlit().

455 {
456  int which;
457 
458  if (surface->format->BitsPerPixel != 1) {
459  /* We don't support sub 8-bit packed pixel modes */
460  return (SDL_BlitFunc) NULL;
461  }
462  if (surface->map->dst->format->BitsPerPixel < 8) {
463  which = 0;
464  } else {
465  which = surface->map->dst->format->BytesPerPixel;
466  }
467  switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
468  case 0:
469  return bitmap_blit[which];
470 
471  case SDL_COPY_COLORKEY:
472  return colorkey_blit[which];
473 
475  return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL;
476 
478  return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL;
479  }
480  return (SDL_BlitFunc) NULL;
481 }
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:39
Uint8 BytesPerPixel
Definition: SDL_pixels.h:320
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:44
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
Uint8 BitsPerPixel
Definition: SDL_pixels.h:319
static void BlitBtoNAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_0.c:354
static void BlitBtoNAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_0.c:399
SDL_Surface * dst
Definition: SDL_blit.h:88
#define NULL
Definition: begin_code.h:164
SDL_PixelFormat * format
Definition: SDL_surface.h:72
#define SDL_COPY_MODULATE_ALPHA
Definition: SDL_blit.h:35
static const SDL_BlitFunc bitmap_blit[]
Definition: SDL_blit_0.c:445
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:73
static const SDL_BlitFunc colorkey_blit[]
Definition: SDL_blit_0.c:449
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_BlitInfo info
Definition: SDL_blit.h:92

◆ SDL_CalculateBlit1()

SDL_BlitFunc SDL_CalculateBlit1 ( SDL_Surface surface)

Definition at line 522 of file SDL_blit_1.c.

References SDL_PixelFormat::BitsPerPixel, Blit1toNAlpha(), Blit1toNAlphaKey(), SDL_PixelFormat::BytesPerPixel, SDL_BlitMap::dst, SDL_BlitInfo::flags, SDL_Surface::format, SDL_BlitMap::info, SDL_Surface::map, NULL, one_blit, one_blitkey, SDL_COPY_BLEND, SDL_COPY_COLORKEY, SDL_COPY_MODULATE_ALPHA, and SDL_COPY_RLE_MASK.

Referenced by SDL_CalculateBlit().

523 {
524  int which;
525  SDL_PixelFormat *dstfmt;
526 
527  dstfmt = surface->map->dst->format;
528  if (dstfmt->BitsPerPixel < 8) {
529  which = 0;
530  } else {
531  which = dstfmt->BytesPerPixel;
532  }
533  switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
534  case 0:
535  return one_blit[which];
536 
537  case SDL_COPY_COLORKEY:
538  return one_blitkey[which];
539 
541  /* Supporting 8bpp->8bpp alpha is doable but requires lots of
542  tables which consume space and takes time to precompute,
543  so is better left to the user */
544  return which >= 2 ? Blit1toNAlpha : (SDL_BlitFunc) NULL;
545 
547  return which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc) NULL;
548  }
549  return (SDL_BlitFunc) NULL;
550 }
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:39
Uint8 BytesPerPixel
Definition: SDL_pixels.h:320
static const SDL_BlitFunc one_blitkey[]
Definition: SDL_blit_1.c:517
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:44
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
Uint8 BitsPerPixel
Definition: SDL_pixels.h:319
static const SDL_BlitFunc one_blit[]
Definition: SDL_blit_1.c:513
static void Blit1toNAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_1.c:471
SDL_Surface * dst
Definition: SDL_blit.h:88
#define NULL
Definition: begin_code.h:164
SDL_PixelFormat * format
Definition: SDL_surface.h:72
#define SDL_COPY_MODULATE_ALPHA
Definition: SDL_blit.h:35
static void Blit1toNAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_1.c:431
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:73
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_BlitInfo info
Definition: SDL_blit.h:92

◆ SDL_CalculateBlitA()

SDL_BlitFunc SDL_CalculateBlitA ( SDL_Surface surface)

Definition at line 1333 of file SDL_blit_A.c.

References SDL_PixelFormat::Aloss, SDL_PixelFormat::Amask, SDL_PixelFormat::Ashift, Blit555to555SurfaceAlpha(), Blit565to565SurfaceAlpha(), BlitARGBto555PixelAlpha(), BlitARGBto565PixelAlpha(), BlitNto1PixelAlpha(), BlitNto1SurfaceAlpha(), BlitNto1SurfaceAlphaKey(), BlitNtoNPixelAlpha(), BlitNtoNSurfaceAlpha(), BlitNtoNSurfaceAlphaKey(), BlitRGBtoRGBPixelAlpha(), BlitRGBtoRGBSurfaceAlpha(), SDL_PixelFormat::Bmask, SDL_PixelFormat::Bshift, SDL_PixelFormat::BytesPerPixel, SDL_BlitMap::dst, SDL_BlitInfo::flags, SDL_Surface::format, SDL_PixelFormat::Gmask, SDL_PixelFormat::Gshift, SDL_BlitMap::identity, SDL_BlitMap::info, SDL_Surface::map, NULL, SDL_PixelFormat::Rmask, SDL_PixelFormat::Rshift, SDL_COPY_BLEND, SDL_COPY_COLORKEY, SDL_COPY_MODULATE_ALPHA, SDL_COPY_RLE_MASK, SDL_Has3DNow, SDL_HasARMSIMD(), SDL_HasMMX, and SDL_HasNEON.

Referenced by SDL_CalculateBlit().

1334 {
1335  SDL_PixelFormat *sf = surface->format;
1336  SDL_PixelFormat *df = surface->map->dst->format;
1337 
1338  switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
1339  case SDL_COPY_BLEND:
1340  /* Per-pixel alpha blits */
1341  switch (df->BytesPerPixel) {
1342  case 1:
1343  return BlitNto1PixelAlpha;
1344 
1345  case 2:
1346 #if SDL_ARM_NEON_BLITTERS || SDL_ARM_SIMD_BLITTERS
1347  if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
1348  && sf->Gmask == 0xff00 && df->Gmask == 0x7e0
1349  && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
1350  || (sf->Bmask == 0xff && df->Bmask == 0x1f)))
1351  {
1352 #if SDL_ARM_NEON_BLITTERS
1353  if (SDL_HasNEON())
1354  return BlitARGBto565PixelAlphaARMNEON;
1355 #endif
1356 #if SDL_ARM_SIMD_BLITTERS
1357  if (SDL_HasARMSIMD())
1358  return BlitARGBto565PixelAlphaARMSIMD;
1359 #endif
1360  }
1361 #endif
1362  if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
1363  && sf->Gmask == 0xff00
1364  && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
1365  || (sf->Bmask == 0xff && df->Bmask == 0x1f))) {
1366  if (df->Gmask == 0x7e0)
1367  return BlitARGBto565PixelAlpha;
1368  else if (df->Gmask == 0x3e0)
1369  return BlitARGBto555PixelAlpha;
1370  }
1371  return BlitNtoNPixelAlpha;
1372 
1373  case 4:
1374  if (sf->Rmask == df->Rmask
1375  && sf->Gmask == df->Gmask
1376  && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) {
1377 #if defined(__MMX__) || defined(__3dNOW__)
1378  if (sf->Rshift % 8 == 0
1379  && sf->Gshift % 8 == 0
1380  && sf->Bshift % 8 == 0
1381  && sf->Ashift % 8 == 0 && sf->Aloss == 0) {
1382 #ifdef __3dNOW__
1383  if (SDL_Has3DNow())
1384  return BlitRGBtoRGBPixelAlphaMMX3DNOW;
1385 #endif
1386 #ifdef __MMX__
1387  if (SDL_HasMMX())
1388  return BlitRGBtoRGBPixelAlphaMMX;
1389 #endif
1390  }
1391 #endif /* __MMX__ || __3dNOW__ */
1392  if (sf->Amask == 0xff000000) {
1393 #if SDL_ARM_NEON_BLITTERS
1394  if (SDL_HasNEON())
1395  return BlitRGBtoRGBPixelAlphaARMNEON;
1396 #endif
1397 #if SDL_ARM_SIMD_BLITTERS
1398  if (SDL_HasARMSIMD())
1399  return BlitRGBtoRGBPixelAlphaARMSIMD;
1400 #endif
1401  return BlitRGBtoRGBPixelAlpha;
1402  }
1403  }
1404  return BlitNtoNPixelAlpha;
1405 
1406  case 3:
1407  default:
1408  break;
1409  }
1410  return BlitNtoNPixelAlpha;
1411 
1413  if (sf->Amask == 0) {
1414  /* Per-surface alpha blits */
1415  switch (df->BytesPerPixel) {
1416  case 1:
1417  return BlitNto1SurfaceAlpha;
1418 
1419  case 2:
1420  if (surface->map->identity) {
1421  if (df->Gmask == 0x7e0) {
1422 #ifdef __MMX__
1423  if (SDL_HasMMX())
1424  return Blit565to565SurfaceAlphaMMX;
1425  else
1426 #endif
1427  return Blit565to565SurfaceAlpha;
1428  } else if (df->Gmask == 0x3e0) {
1429 #ifdef __MMX__
1430  if (SDL_HasMMX())
1431  return Blit555to555SurfaceAlphaMMX;
1432  else
1433 #endif
1434  return Blit555to555SurfaceAlpha;
1435  }
1436  }
1437  return BlitNtoNSurfaceAlpha;
1438 
1439  case 4:
1440  if (sf->Rmask == df->Rmask
1441  && sf->Gmask == df->Gmask
1442  && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) {
1443 #ifdef __MMX__
1444  if (sf->Rshift % 8 == 0
1445  && sf->Gshift % 8 == 0
1446  && sf->Bshift % 8 == 0 && SDL_HasMMX())
1447  return BlitRGBtoRGBSurfaceAlphaMMX;
1448 #endif
1449  if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) {
1450  return BlitRGBtoRGBSurfaceAlpha;
1451  }
1452  }
1453  return BlitNtoNSurfaceAlpha;
1454 
1455  case 3:
1456  default:
1457  return BlitNtoNSurfaceAlpha;
1458  }
1459  }
1460  break;
1461 
1463  if (sf->Amask == 0) {
1464  if (df->BytesPerPixel == 1) {
1465  return BlitNto1SurfaceAlphaKey;
1466  } else {
1467  return BlitNtoNSurfaceAlphaKey;
1468  }
1469  }
1470  break;
1471  }
1472 
1473  return NULL;
1474 }
static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1118
static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:30
#define SDL_Has3DNow
static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1250
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:39
Uint8 BytesPerPixel
Definition: SDL_pixels.h:320
static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:123
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:44
static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1164
static void BlitNtoNPixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1291
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1079
static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1040
#define SDL_HasNEON
static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:525
static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:483
#define SDL_HasMMX
SDL_Surface * dst
Definition: SDL_blit.h:88
#define NULL
Definition: begin_code.h:164
SDL_PixelFormat * format
Definition: SDL_surface.h:72
SDL_bool SDL_HasARMSIMD(void)
Definition: SDL_cpuinfo.c:777
#define SDL_COPY_MODULATE_ALPHA
Definition: SDL_blit.h:35
static void BlitNto1PixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:77
static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1211
int identity
Definition: SDL_blit.h:89
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_BlitInfo info
Definition: SDL_blit.h:92

◆ SDL_CalculateBlitN()

SDL_BlitFunc SDL_CalculateBlitN ( SDL_Surface surface)

Definition at line 2638 of file SDL_blit_N.c.

References blit_table::alpha, SDL_PixelFormat::Amask, SDL_PixelFormat::BitsPerPixel, Blit2101010toN(), Blit2to2Key(), Blit4to4CopyAlpha(), Blit4to4MaskAlpha(), blit_table::blit_features, Blit_RGB101010_index8(), Blit_RGB888_index8(), blit_table::blitfunc, BlitNto1(), BlitNto1Key(), BlitNto2101010(), BlitNtoN(), BlitNtoNCopyAlpha(), BlitNtoNKey(), BlitNtoNKeyCopyAlpha(), SDL_PixelFormat::Bmask, SDL_PixelFormat::BytesPerPixel, COPY_ALPHA, SDL_BlitMap::dst, blit_table::dstB, blit_table::dstbpp, blit_table::dstG, blit_table::dstR, SDL_BlitInfo::flags, SDL_Surface::format, SDL_PixelFormat::format, GetBlitFeatures, SDL_PixelFormat::Gmask, SDL_BlitMap::identity, SDL_BlitMap::info, SDL_Surface::map, MASKOK, NO_ALPHA, NULL, SDL_PixelFormat::Rmask, SDL_COPY_COLORKEY, SDL_COPY_RLE_MASK, SDL_HasAltiVec, SDL_PIXELFORMAT_ARGB2101010, SET_ALPHA, blit_table::srcB, blit_table::srcG, and blit_table::srcR.

Referenced by SDL_CalculateBlit().

2639 {
2640  SDL_PixelFormat *srcfmt;
2641  SDL_PixelFormat *dstfmt;
2642  const struct blit_table *table;
2643  int which;
2644  SDL_BlitFunc blitfun;
2645 
2646  /* Set up data for choosing the blit */
2647  srcfmt = surface->format;
2648  dstfmt = surface->map->dst->format;
2649 
2650  /* We don't support destinations less than 8-bits */
2651  if (dstfmt->BitsPerPixel < 8) {
2652  return (NULL);
2653  }
2654 
2655  switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
2656  case 0:
2657  blitfun = NULL;
2658  if (dstfmt->BitsPerPixel == 8) {
2659  if ((srcfmt->BytesPerPixel == 4) &&
2660  (srcfmt->Rmask == 0x00FF0000) &&
2661  (srcfmt->Gmask == 0x0000FF00) &&
2662  (srcfmt->Bmask == 0x000000FF)) {
2663  blitfun = Blit_RGB888_index8;
2664  } else if ((srcfmt->BytesPerPixel == 4) &&
2665  (srcfmt->Rmask == 0x3FF00000) &&
2666  (srcfmt->Gmask == 0x000FFC00) &&
2667  (srcfmt->Bmask == 0x000003FF)) {
2668  blitfun = Blit_RGB101010_index8;
2669  } else {
2670  blitfun = BlitNto1;
2671  }
2672  } else {
2673  /* Now the meat, choose the blitter we want */
2674  int a_need = NO_ALPHA;
2675  if (dstfmt->Amask)
2676  a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
2677  table = normal_blit[srcfmt->BytesPerPixel - 1];
2678  for (which = 0; table[which].dstbpp; ++which) {
2679  if (MASKOK(srcfmt->Rmask, table[which].srcR) &&
2680  MASKOK(srcfmt->Gmask, table[which].srcG) &&
2681  MASKOK(srcfmt->Bmask, table[which].srcB) &&
2682  MASKOK(dstfmt->Rmask, table[which].dstR) &&
2683  MASKOK(dstfmt->Gmask, table[which].dstG) &&
2684  MASKOK(dstfmt->Bmask, table[which].dstB) &&
2685  dstfmt->BytesPerPixel == table[which].dstbpp &&
2686  (a_need & table[which].alpha) == a_need &&
2687  ((table[which].blit_features & GetBlitFeatures()) ==
2688  table[which].blit_features))
2689  break;
2690  }
2691  blitfun = table[which].blitfunc;
2692 
2693  if (blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */
2694  if (srcfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
2695  blitfun = Blit2101010toN;
2696  } else if (dstfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
2697  blitfun = BlitNto2101010;
2698  } else if (srcfmt->BytesPerPixel == 4 &&
2699  dstfmt->BytesPerPixel == 4 &&
2700  srcfmt->Rmask == dstfmt->Rmask &&
2701  srcfmt->Gmask == dstfmt->Gmask &&
2702  srcfmt->Bmask == dstfmt->Bmask) {
2703  if (a_need == COPY_ALPHA) {
2704  if (srcfmt->Amask == dstfmt->Amask) {
2705  /* Fastpath C fallback: 32bit RGBA<->RGBA blit with matching RGBA */
2706  blitfun = Blit4to4CopyAlpha;
2707  } else {
2708  blitfun = BlitNtoNCopyAlpha;
2709  }
2710  } else {
2711  /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
2712  blitfun = Blit4to4MaskAlpha;
2713  }
2714  } else if (a_need == COPY_ALPHA) {
2715  blitfun = BlitNtoNCopyAlpha;
2716  }
2717  }
2718  }
2719  return (blitfun);
2720 
2721  case SDL_COPY_COLORKEY:
2722  /* colorkey blit: Here we don't have too many options, mostly
2723  because RLE is the preferred fast way to deal with this.
2724  If a particular case turns out to be useful we'll add it. */
2725 
2726  if (srcfmt->BytesPerPixel == 2 && surface->map->identity)
2727  return Blit2to2Key;
2728  else if (dstfmt->BytesPerPixel == 1)
2729  return BlitNto1Key;
2730  else {
2731 #if SDL_ALTIVEC_BLITTERS
2732  if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4)
2733  && SDL_HasAltiVec()) {
2734  return Blit32to32KeyAltivec;
2735  } else
2736 #endif
2737  if (srcfmt->Amask && dstfmt->Amask) {
2738  return BlitNtoNKeyCopyAlpha;
2739  } else {
2740  return BlitNtoNKey;
2741  }
2742  }
2743  }
2744 
2745  return NULL;
2746 }
SDL_BlitFunc blitfunc
Definition: SDL_blit_N.c:2568
#define SDL_HasAltiVec
Uint32 srcG
Definition: SDL_blit_N.c:2564
Uint32 srcB
Definition: SDL_blit_N.c:2564
#define MASKOK(x, y)
Definition: SDL_blit_N.c:2635
GLenum GLsizei GLenum GLenum const void * table
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:39
Uint32 dstB
Definition: SDL_blit_N.c:2566
Uint32 dstR
Definition: SDL_blit_N.c:2566
Uint8 BytesPerPixel
Definition: SDL_pixels.h:320
#define NO_ALPHA
Definition: SDL_blit_N.c:2559
static void BlitNto2101010(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2528
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:44
enum blit_features blit_features
Definition: SDL_blit_N.c:2567
Uint32 srcR
Definition: SDL_blit_N.c:2564
static void BlitNtoNCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2228
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
#define SET_ALPHA
Definition: SDL_blit_N.c:2560
Uint32 dstG
Definition: SDL_blit_N.c:2566
static void Blit2to2Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2323
Uint8 BitsPerPixel
Definition: SDL_pixels.h:319
static void Blit4to4MaskAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2117
static void BlitNto1Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2257
static void Blit_RGB888_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:937
SDL_Surface * dst
Definition: SDL_blit.h:88
#define NULL
Definition: begin_code.h:164
SDL_PixelFormat * format
Definition: SDL_surface.h:72
static const struct blit_table *const normal_blit[]
Definition: SDL_blit_N.c:2630
static void BlitNtoNKey(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2357
#define COPY_ALPHA
Definition: SDL_blit_N.c:2561
static void Blit2101010toN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2496
static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2425
#define GetBlitFeatures()
Definition: SDL_blit_N.c:886
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:73
Uint32 alpha
Definition: SDL_blit_N.c:2569
static void Blit_RGB101010_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1047
blit_features
Definition: SDL_blit_N.c:32
static void Blit4to4CopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2167
static void BlitNtoN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2193
int identity
Definition: SDL_blit.h:89
SDL_BlitInfo info
Definition: SDL_blit.h:92
static void BlitNto1(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2022

Variable Documentation

◆ SDL_expand_byte

Uint8* SDL_expand_byte[9]

Definition at line 71 of file SDL_pixels.c.

Referenced by SDL_GetRGB(), and SDL_GetRGBA().