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

Uint8 * | SDL_expand_byte [9]

## Macro Definition Documentation

#define ABGR8888_FROM_RGBA | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Value:
{ \
Pixel = (a<<24)|(b<<16)|(g<<8)|r; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 244 of file SDL_blit.h.

#define ALPHA_BLEND_RGB | ( |  | sR,
|  |  | sG,
|  |  | sB,
|  |  | A,
|  |  | dR,
|  |  | dG,
|  |  | dB
| ) |  |

Value:
do { \
dR = ((((unsigned)(sR-dR)*(unsigned)A)/255)+dR); \
dG = ((((unsigned)(sG-dG)*(unsigned)A)/255)+dG); \
dB = ((((unsigned)(sB-dB)*(unsigned)A)/255)+dB); \
} while(0)

Definition at line 444 of file SDL_blit.h.

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

#define ALPHA_BLEND_RGBA | ( |  | sR,
|  |  | sG,
|  |  | sB,
|  |  | sA,
|  |  | dR,
|  |  | dG,
|  |  | dB,
|  |  | dA
| ) |  |

Value:
do { \
dR = ((((unsigned)(sR-dR)*(unsigned)sA)/255)+dR); \
dG = ((((unsigned)(sG-dG)*(unsigned)sA)/255)+dG); \
dB = ((((unsigned)(sB-dB)*(unsigned)sA)/255)+dB); \
dA = ((unsigned)sA+(unsigned)dA-((unsigned)sA*dA)/255); \
} while(0)

Definition at line 453 of file SDL_blit.h.

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

#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; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 252 of file SDL_blit.h.

Referenced by BlitNto2101010().

#define ARGB8888_FROM_RGBA | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Value:
{ \
Pixel = (a<<24)|(r<<16)|(g<<8)|b; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 236 of file SDL_blit.h.

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

Definition at line 260 of file SDL_blit.h.

Referenced by SDL_Blit_Slow().

#define ASSEMBLE_RGBA | ( |  | buf,
|  |  | bpp,
|  |  | fmt,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Definition at line 401 of file SDL_blit.h.

Referenced by Blit1toNAlpha(), Blit1toNAlphaKey(), Blit2101010toN(), BlitBtoNAlpha(), BlitBtoNAlphaKey(), BlitNtoN(), BlitNtoNCopyAlpha(), BlitNtoNKey(), BlitNtoNKeyCopyAlpha(), BlitNtoNPixelAlpha(), BlitNtoNSurfaceAlpha(), BlitNtoNSurfaceAlphaKey(), Map1toN(), and SDL_Blit_Slow().

#define BGRA8888_FROM_RGBA | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Value:
{ \
Pixel = (b<<24)|(g<<16)|(r<<8)|a; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 248 of file SDL_blit.h.

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

Definition at line 117 of file SDL_blit.h.

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

Definition at line 176 of file SDL_blit.h.

Referenced by BlitNto1(), BlitNto1Key(), BlitNto1SurfaceAlpha(), BlitNto1SurfaceAlphaKey(), BlitNtoN(), BlitNtoNSurfaceAlpha(), and SDL_Blit_Slow().

#define DISEMBLE_RGBA | ( |  | buf,
|  |  | bpp,
|  |  | fmt,
|  |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Definition at line 352 of file SDL_blit.h.

Referenced by Blit1toNAlpha(), Blit1toNAlphaKey(), BlitBtoNAlpha(), BlitBtoNAlphaKey(), BlitNto1PixelAlpha(), BlitNto2101010(), BlitNtoNCopyAlpha(), BlitNtoNKeyCopyAlpha(), BlitNtoNPixelAlpha(), BlitNtoNSurfaceAlpha(), BlitNtoNSurfaceAlphaKey(), and SDL_Blit_Slow().

#define DUFFS_LOOP | ( |  | pixel_copy_increment,
|  |  | width
| ) |  | DUFFS_LOOP8(pixel_copy_increment, width)

Definition at line 499 of file SDL_blit.h.

Referenced by Blit1to1(), Blit1to1Key(), Blit1to2(), Blit1to2Key(), Blit1to3(), Blit1to3Key(), Blit1to4(), Blit1to4Key(), Blit1toNAlphaKey(), Blit2101010toN(), Blit2to2Key(), Blit4to4CopyAlpha(), Blit4to4MaskAlpha(), Blit_RGB101010_index8(), Blit_RGB565_32(), Blit_RGB888_index8(), Blit_RGB888_RGB555(), Blit_RGB888_RGB565(), BlitNto1(), BlitNto1Key(), BlitNto1SurfaceAlphaKey(), BlitNto2101010(), BlitNtoN(), BlitNtoNKey(), and BlitNtoNKeyCopyAlpha().

#define DUFFS_LOOP4 | ( |  | pixel_copy_increment,
|  |  | width
| ) |  |

Value:
{ int n = (width+3)/4; \
switch (width & 3) { \
case 0: do { pixel_copy_increment; \
case 3: pixel_copy_increment; \
case 2: pixel_copy_increment; \
case 1: pixel_copy_increment; \
} while (--n > 0); \
} \
}
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1565
n
GLdouble n
Definition: SDL_opengl_glext.h:1952

Definition at line 487 of file SDL_blit.h.

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

#define DUFFS_LOOP8 | ( |  | pixel_copy_increment,
|  |  | width
| ) |  |

Value:
{ int n = (width+7)/8; \
switch (width & 7) { \
case 0: do { pixel_copy_increment; \
case 7: pixel_copy_increment; \
case 6: pixel_copy_increment; \
case 5: pixel_copy_increment; \
case 4: pixel_copy_increment; \
case 3: pixel_copy_increment; \
case 2: pixel_copy_increment; \
case 1: pixel_copy_increment; \
} while ( --n > 0 ); \
} \
}
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1565
n
GLdouble n
Definition: SDL_opengl_glext.h:1952

Definition at line 471 of file SDL_blit.h.

#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); \
} \
}
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1565
n
GLdouble n
Definition: SDL_opengl_glext.h:1952

Definition at line 503 of file SDL_blit.h.

Referenced by Blit16to16SurfaceAlpha128().

#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; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 217 of file SDL_blit.h.

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

#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); \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 394 of file SDL_blit.h.

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

#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); \
if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
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)
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_LIL_ENDIAN
#define SDL_LIL_ENDIAN
Definition: SDL_endian.h:37
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
buf
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: SDL_opengl_glext.h:2480
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:147
SDL_BYTEORDER
#define SDL_BYTEORDER
Definition: SDL_config_pandora.h:36

Definition at line 145 of file SDL_blit.h.

Referenced by BlitNtoNKey(), and BlitNtoNSurfaceAlphaKey().

#define RGB555_FROM_RGB | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b
| ) |  |

Value:
{ \
Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3); \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 228 of file SDL_blit.h.

#define RGB565_FROM_RGB | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b
| ) |  |

Value:
{ \
Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 224 of file SDL_blit.h.

#define RGB888_FROM_RGB | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b
| ) |  |

Value:
{ \
Pixel = (r<<16)|(g<<8)|b; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 232 of file SDL_blit.h.

#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)]; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
SDL_expand_byte
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 121 of file SDL_blit.h.

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

#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)]; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
SDL_expand_byte
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 133 of file SDL_blit.h.

#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)]; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
SDL_expand_byte
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 127 of file SDL_blit.h.

#define RGB_FROM_RGB888 | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b
| ) |  |

Value:
{ \
r = ((Pixel&0xFF0000)>>16); \
g = ((Pixel&0xFF00)>>8); \
b = (Pixel&0xFF); \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 139 of file SDL_blit.h.

#define RGBA8888_FROM_RGBA | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Value:
{ \
Pixel = (r<<24)|(g<<16)|(b<<8)|a; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 240 of file SDL_blit.h.

#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; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 310 of file SDL_blit.h.

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

#define RGBA_FROM_ABGR8888 | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Value:
{ \
r = (Pixel&0xFF); \
g = ((Pixel>>8)&0xFF); \
b = ((Pixel>>16)&0xFF); \
a = (Pixel>>24); \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 331 of file SDL_blit.h.

#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)]; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
SDL_expand_byte
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 345 of file SDL_blit.h.

Referenced by Blit2101010toN().

#define RGBA_FROM_ARGB8888 | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Value:
{ \
r = ((Pixel>>16)&0xFF); \
g = ((Pixel>>8)&0xFF); \
b = (Pixel&0xFF); \
a = (Pixel>>24); \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 324 of file SDL_blit.h.

#define RGBA_FROM_BGRA8888 | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Value:
{ \
r = ((Pixel>>8)&0xFF); \
g = ((Pixel>>16)&0xFF); \
b = (Pixel>>24); \
a = (Pixel&0xFF); \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 338 of file SDL_blit.h.

#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)]; \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
SDL_expand_byte
Uint8 * SDL_expand_byte[9]
Definition: SDL_pixels.c:71
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 303 of file SDL_blit.h.

#define RGBA_FROM_RGBA8888 | ( |  | Pixel,
|  |  | r,
|  |  | g,
|  |  | b,
|  |  | a
| ) |  |

Value:
{ \
r = (Pixel>>24); \
g = ((Pixel>>16)&0xFF); \
b = ((Pixel>>8)&0xFF); \
a = (Pixel&0xFF); \
}
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2072
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109

Definition at line 317 of file SDL_blit.h.

#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().

#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().

#define SDL_COPY_COLORKEY 0x00000100

Definition at line 39 of file SDL_blit.h.

Referenced by SDL_Blit_Slow(), SDL_CalculateBlit0(), SDL_CalculateBlit1(), SDL_CalculateBlitA(), SDL_CalculateBlitN(), SDL_ChooseBlitFunc(), SDL_ConvertColorkeyToAlpha(), SDL_ConvertSurface(), SDL_GetColorKey(), SDL_LowerBlitScaled(), SDL_RLESurface(), SDL_SaveBMP_RW(), and SDL_SetColorKey().

#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().

#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().

#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().

#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().

#define SDL_COPY_RLE_ALPHAKEY 0x00004000

Definition at line 43 of file SDL_blit.h.

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

#define SDL_COPY_RLE_COLORKEY 0x00002000

Definition at line 42 of file SDL_blit.h.

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

#define SDL_COPY_RLE_DESIRED 0x00001000

Definition at line 41 of file SDL_blit.h.

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

#define SDL_COPY_RLE_MASK (SDL_COPY_RLE_DESIRED|SDL_COPY_RLE_COLORKEY|SDL_COPY_RLE_ALPHAKEY)

Definition at line 44 of file SDL_blit.h.

Referenced by SDL_CalculateBlit0(), SDL_CalculateBlit1(), SDL_CalculateBlitA(), and SDL_CalculateBlitN().

#define SDL_CPU_3DNOW 0x00000002

Definition at line 49 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

#define SDL_CPU_ALTIVEC_NOPREFETCH 0x00000020

Definition at line 53 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

#define SDL_CPU_ALTIVEC_PREFETCH 0x00000010

Definition at line 52 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

#define SDL_CPU_ANY 0x00000000

Definition at line 47 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

#define SDL_CPU_MMX 0x00000001

Definition at line 48 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

#define SDL_CPU_SSE 0x00000004

Definition at line 50 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

#define SDL_CPU_SSE2 0x00000008

Definition at line 51 of file SDL_blit.h.

Referenced by SDL_ChooseBlitFunc().

#define USE_DUFFS_LOOP

Definition at line 466 of file SDL_blit.h.

Referenced by Blit1to2().

## Typedef Documentation

typedef void( * SDL_BlitFunc) (SDL_BlitInfo *info)

Definition at line 73 of file SDL_blit.h.

## Function Documentation

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_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().

{
SDL_BlitFunc blit = NULL;
SDL_BlitMap *map = surface->map;
SDL_Surface *dst = map->dst;
/* Clean everything out to start */
if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) {
SDL_UnRLESurface(surface, 1);
}
map->blit = SDL_SoftBlit;
map->info.src_fmt = surface->format;
map->info.src_pitch = surface->pitch;
map->info.dst_fmt = dst->format;
map->info.dst_pitch = dst->pitch;
/* See if we can do RLE acceleration */
if (map->info.flags & SDL_COPY_RLE_DESIRED) {
if (SDL_RLESurface(surface) == 0) {
return 0;
}
}
/* Choose a standard blit function */
if (map->identity && !(map->info.flags & ~SDL_COPY_RLE_DESIRED)) {
blit = SDL_BlitCopy;
} else if (surface->format->BitsPerPixel < 8 &&
SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) {
blit = SDL_CalculateBlit0(surface);
} else if (surface->format->BytesPerPixel == 1 &&
SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) {
blit = SDL_CalculateBlit1(surface);
} else if (map->info.flags & SDL_COPY_BLEND) {
blit = SDL_CalculateBlitA(surface);
} else {
blit = SDL_CalculateBlitN(surface);
}
if (blit == NULL) {
Uint32 src_format = surface->format->format;
Uint32 dst_format = dst->format->format;
blit =
SDL_ChooseBlitFunc(src_format, dst_format, map->info.flags,
SDL_GeneratedBlitFuncTable);
}
#ifndef TEST_SLOW_BLIT
if (blit == NULL)
#endif
{
Uint32 src_format = surface->format->format;
Uint32 dst_format = dst->format->format;
if (!SDL_ISPIXELFORMAT_INDEXED(src_format) &&
!SDL_ISPIXELFORMAT_FOURCC(src_format) &&
!SDL_ISPIXELFORMAT_INDEXED(dst_format) &&
!SDL_ISPIXELFORMAT_FOURCC(dst_format)) {
blit = SDL_Blit_Slow;
}
}
map->data = blit;
/* Make sure we have a blit function */
if (blit == NULL) {
SDL_InvalidateMap(map);
return SDL_SetError("Blit combination not supported");
}
return 0;
}
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_CalculateBlitN
SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface)
Definition: SDL_blit_N.c:2527
SDL_BlitMap::blit
SDL_blit blit
Definition: SDL_blit.h:89
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:155
SDL_ISPIXELFORMAT_INDEXED
#define SDL_ISPIXELFORMAT_INDEXED(format)
Definition: SDL_pixels.h:133
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:304
SDL_BlitInfo::flags
int flags
Definition: SDL_blit.h:68
SDL_BlitInfo::src_fmt
SDL_PixelFormat * src_fmt
Definition: SDL_blit.h:65
SDL_Blit_Slow
void SDL_Blit_Slow(SDL_BlitInfo *info)
Definition: SDL_blit_slow.c:31
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
SDL_UnRLESurface
void SDL_UnRLESurface(SDL_Surface *surface, int recode)
Definition: SDL_RLEaccel.c:1540
SDL_BlitInfo::dst_pitch
int dst_pitch
Definition: SDL_blit.h:63
SDL_Surface::flags
Uint32 flags
Definition: SDL_surface.h:71
SDL_COPY_RLE_DESIRED
#define SDL_COPY_RLE_DESIRED
Definition: SDL_blit.h:41
SDL_InvalidateMap
void SDL_InvalidateMap(SDL_BlitMap *map)
Definition: SDL_pixels.c:974
SDL_Surface::map
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
SDL_BlitCopy
void SDL_BlitCopy(SDL_BlitInfo *info)
Definition: SDL_blit_copy.c:91
SDL_ChooseBlitFunc
static SDL_BlitFunc SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags, SDL_BlitFuncEntry *entries)
Definition: SDL_blit.c:128
SDL_PixelFormat::BitsPerPixel
Uint8 BitsPerPixel
Definition: SDL_pixels.h:303
SDL_BlitInfo::dst_fmt
SDL_PixelFormat * dst_fmt
Definition: SDL_blit.h:66
SDL_GeneratedBlitFuncTable
SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[]
Definition: SDL_blit_auto.c:7287
SDL_BlitInfo::src_pitch
int src_pitch
Definition: SDL_blit.h:59
SDL_RLESurface
int SDL_RLESurface(SDL_Surface *surface)
Definition: SDL_RLEaccel.c:1403
SDL_BlitMap::dst
SDL_Surface * dst
Definition: SDL_blit.h:87
NULL
#define NULL
Definition: begin_code.h:143
SDL_Surface::format
SDL_PixelFormat * format
Definition: SDL_surface.h:72
SDL_CalculateBlit0
SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface)
Definition: SDL_blit_0.c:454
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:36
SDL_CalculateBlit1
SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface *surface)
Definition: SDL_blit_1.c:520
SDL_BlitFunc
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:73
SDL_Surface::pitch
int pitch
Definition: SDL_surface.h:74
SDL_SoftBlit
static int SDL_SoftBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
Definition: SDL_blit.c:34
SDL_BlitMap::data
void * data
Definition: SDL_blit.h:90
SDL_ISPIXELFORMAT_FOURCC
#define SDL_ISPIXELFORMAT_FOURCC(format)
Definition: SDL_pixels.h:166
SDL_BlitMap
Definition: SDL_blit.h:85
SDL_PixelFormat::format
Uint32 format
Definition: SDL_pixels.h:301
map
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:289
SDL_CalculateBlitA
SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface)
Definition: SDL_blit_A.c:1269
SDL_BlitMap::identity
int identity
Definition: SDL_blit.h:88
SDL_COPY_BLEND
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_BlitMap::info
SDL_BlitInfo info
Definition: SDL_blit.h:91
SDL_RLEACCEL
#define SDL_RLEACCEL
Definition: SDL_surface.h:54

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().

{
int which;
if (surface->format->BitsPerPixel != 1) {
/* We don't support sub 8-bit packed pixel modes */
return (SDL_BlitFunc) NULL;
}
if (surface->map->dst->format->BitsPerPixel < 8) {
which = 0;
} else {
which = surface->map->dst->format->BytesPerPixel;
}
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
case 0:
return bitmap_blit[which];
case SDL_COPY_COLORKEY:
return colorkey_blit[which];
case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL;
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL;
}
return (SDL_BlitFunc) NULL;
}
SDL_COPY_COLORKEY
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:39
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:304
SDL_BlitInfo::flags
int flags
Definition: SDL_blit.h:68
SDL_COPY_RLE_MASK
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:44
SDL_Surface::map
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
SDL_PixelFormat::BitsPerPixel
Uint8 BitsPerPixel
Definition: SDL_pixels.h:303
BlitBtoNAlpha
static void BlitBtoNAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_0.c:354
BlitBtoNAlphaKey
static void BlitBtoNAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_0.c:399
SDL_BlitMap::dst
SDL_Surface * dst
Definition: SDL_blit.h:87
NULL
#define NULL
Definition: begin_code.h:143
SDL_Surface::format
SDL_PixelFormat * format
Definition: SDL_surface.h:72
SDL_COPY_MODULATE_ALPHA
#define SDL_COPY_MODULATE_ALPHA
Definition: SDL_blit.h:35
bitmap_blit
static const SDL_BlitFunc bitmap_blit[]
Definition: SDL_blit_0.c:445
SDL_BlitFunc
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:73
colorkey_blit
static const SDL_BlitFunc colorkey_blit[]
Definition: SDL_blit_0.c:449
SDL_COPY_BLEND
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_BlitMap::info
SDL_BlitInfo info
Definition: SDL_blit.h:91

SDL_BlitFunc SDL_CalculateBlit1 | ( | SDL_Surface * | surface | ) |

Definition at line 520 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().

{
int which;
SDL_PixelFormat *dstfmt;
dstfmt = surface->map->dst->format;
if (dstfmt->BitsPerPixel < 8) {
which = 0;
} else {
which = dstfmt->BytesPerPixel;
}
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
case 0:
return one_blit[which];
case SDL_COPY_COLORKEY:
return one_blitkey[which];
case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
/* Supporting 8bpp->8bpp alpha is doable but requires lots of
tables which consume space and takes time to precompute,
so is better left to the user */
return which >= 2 ? Blit1toNAlpha : (SDL_BlitFunc) NULL;
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
return which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc) NULL;
}
return (SDL_BlitFunc) NULL;
}
SDL_COPY_COLORKEY
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:39
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:304
SDL_BlitInfo::flags
int flags
Definition: SDL_blit.h:68
one_blitkey
static const SDL_BlitFunc one_blitkey[]
Definition: SDL_blit_1.c:515
SDL_COPY_RLE_MASK
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:44
SDL_Surface::map
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
SDL_PixelFormat::BitsPerPixel
Uint8 BitsPerPixel
Definition: SDL_pixels.h:303
one_blit
static const SDL_BlitFunc one_blit[]
Definition: SDL_blit_1.c:511
Blit1toNAlphaKey
static void Blit1toNAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_1.c:469
SDL_BlitMap::dst
SDL_Surface * dst
Definition: SDL_blit.h:87
NULL
#define NULL
Definition: begin_code.h:143
SDL_Surface::format
SDL_PixelFormat * format
Definition: SDL_surface.h:72
SDL_COPY_MODULATE_ALPHA
#define SDL_COPY_MODULATE_ALPHA
Definition: SDL_blit.h:35
SDL_PixelFormat
Definition: SDL_pixels.h:299
Blit1toNAlpha
static void Blit1toNAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_1.c:429
SDL_BlitFunc
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:73
SDL_COPY_BLEND
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_BlitMap::info
SDL_BlitInfo info
Definition: SDL_blit.h:91

SDL_BlitFunc SDL_CalculateBlitA | ( | SDL_Surface * | surface | ) |

Definition at line 1269 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, and SDL_HasMMX.

Referenced by SDL_CalculateBlit().

{
SDL_PixelFormat *sf = surface->format;
SDL_PixelFormat *df = surface->map->dst->format;
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
case SDL_COPY_BLEND:
/* Per-pixel alpha blits */
switch (df->BytesPerPixel) {
case 1:
return BlitNto1PixelAlpha;
case 2:
if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
&& sf->Gmask == 0xff00
&& ((sf->Rmask == 0xff && df->Rmask == 0x1f)
|| (sf->Bmask == 0xff && df->Bmask == 0x1f))) {
if (df->Gmask == 0x7e0)
return BlitARGBto565PixelAlpha;
else if (df->Gmask == 0x3e0)
return BlitARGBto555PixelAlpha;
}
return BlitNtoNPixelAlpha;
case 4:
if (sf->Rmask == df->Rmask
&& sf->Gmask == df->Gmask
&& sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) {
#if defined(__MMX__) || defined(__3dNOW__)
if (sf->Rshift % 8 == 0
&& sf->Gshift % 8 == 0
&& sf->Bshift % 8 == 0
&& sf->Ashift % 8 == 0 && sf->Aloss == 0) {
#ifdef __3dNOW__
if (SDL_Has3DNow())
return BlitRGBtoRGBPixelAlphaMMX3DNOW;
#endif
#ifdef __MMX__
if (SDL_HasMMX())
return BlitRGBtoRGBPixelAlphaMMX;
#endif
}
#endif /* __MMX__ || __3dNOW__ */
if (sf->Amask == 0xff000000) {
return BlitRGBtoRGBPixelAlpha;
}
}
return BlitNtoNPixelAlpha;
case 3:
default:
return BlitNtoNPixelAlpha;
}
break;
case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
if (sf->Amask == 0) {
/* Per-surface alpha blits */
switch (df->BytesPerPixel) {
case 1:
return BlitNto1SurfaceAlpha;
case 2:
if (surface->map->identity) {
if (df->Gmask == 0x7e0) {
#ifdef __MMX__
if (SDL_HasMMX())
return Blit565to565SurfaceAlphaMMX;
else
#endif
return Blit565to565SurfaceAlpha;
} else if (df->Gmask == 0x3e0) {
#ifdef __MMX__
if (SDL_HasMMX())
return Blit555to555SurfaceAlphaMMX;
else
#endif
return Blit555to555SurfaceAlpha;
}
}
return BlitNtoNSurfaceAlpha;
case 4:
if (sf->Rmask == df->Rmask
&& sf->Gmask == df->Gmask
&& sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) {
#ifdef __MMX__
if (sf->Rshift % 8 == 0
&& sf->Gshift % 8 == 0
&& sf->Bshift % 8 == 0 && SDL_HasMMX())
return BlitRGBtoRGBSurfaceAlphaMMX;
#endif
if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) {
return BlitRGBtoRGBSurfaceAlpha;
}
}
return BlitNtoNSurfaceAlpha;
case 3:
default:
return BlitNtoNSurfaceAlpha;
}
}
break;
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND:
if (sf->Amask == 0) {
if (df->BytesPerPixel == 1) {
return BlitNto1SurfaceAlphaKey;
} else {
return BlitNtoNSurfaceAlphaKey;
}
}
break;
}
return NULL;
}
SDL_PixelFormat::Aloss
Uint8 Aloss
Definition: SDL_pixels.h:313
BlitARGBto565PixelAlpha
static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1054
BlitNto1SurfaceAlpha
static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:30
SDL_Has3DNow
#define SDL_Has3DNow
Definition: SDL_dynapi_overrides.h:112
BlitNtoNSurfaceAlphaKey
static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1186
SDL_COPY_COLORKEY
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:39
SDL_PixelFormat::Gmask
Uint32 Gmask
Definition: SDL_pixels.h:307
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:304
SDL_BlitInfo::flags
int flags
Definition: SDL_blit.h:68
BlitNto1SurfaceAlphaKey
static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:123
SDL_PixelFormat::Bmask
Uint32 Bmask
Definition: SDL_pixels.h:308
SDL_PixelFormat::Ashift
Uint8 Ashift
Definition: SDL_pixels.h:317
SDL_COPY_RLE_MASK
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:44
BlitARGBto555PixelAlpha
static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1100
BlitNtoNPixelAlpha
static void BlitNtoNPixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1227
SDL_Surface::map
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
Blit555to555SurfaceAlpha
static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1015
SDL_PixelFormat::Bshift
Uint8 Bshift
Definition: SDL_pixels.h:316
SDL_PixelFormat::Rshift
Uint8 Rshift
Definition: SDL_pixels.h:314
Blit565to565SurfaceAlpha
static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:976
BlitRGBtoRGBPixelAlpha
static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:461
BlitRGBtoRGBSurfaceAlpha
static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:419
SDL_HasMMX
#define SDL_HasMMX
Definition: SDL_dynapi_overrides.h:111
SDL_BlitMap::dst
SDL_Surface * dst
Definition: SDL_blit.h:87
NULL
#define NULL
Definition: begin_code.h:143
SDL_Surface::format
SDL_PixelFormat * format
Definition: SDL_surface.h:72
SDL_PixelFormat::Gshift
Uint8 Gshift
Definition: SDL_pixels.h:315
SDL_PixelFormat::Rmask
Uint32 Rmask
Definition: SDL_pixels.h:306
SDL_COPY_MODULATE_ALPHA
#define SDL_COPY_MODULATE_ALPHA
Definition: SDL_blit.h:35
BlitNto1PixelAlpha
static void BlitNto1PixelAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:77
SDL_PixelFormat
Definition: SDL_pixels.h:299
BlitNtoNSurfaceAlpha
static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_A.c:1147
SDL_PixelFormat::Amask
Uint32 Amask
Definition: SDL_pixels.h:309
SDL_BlitMap::identity
int identity
Definition: SDL_blit.h:88
SDL_COPY_BLEND
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_BlitMap::info
SDL_BlitInfo info
Definition: SDL_blit.h:91

SDL_BlitFunc SDL_CalculateBlitN | ( | SDL_Surface * | surface | ) |

Definition at line 2527 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, blit_table::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, blit_table::NO_ALPHA, NULL, SDL_PixelFormat::Rmask, SDL_COPY_COLORKEY, SDL_COPY_RLE_MASK, SDL_HasAltiVec, SDL_PIXELFORMAT_ARGB2101010, blit_table::SET_ALPHA, blit_table::srcB, blit_table::srcG, and blit_table::srcR.

Referenced by SDL_CalculateBlit().

{
SDL_PixelFormat *srcfmt;
SDL_PixelFormat *dstfmt;
const struct blit_table *table;
int which;
SDL_BlitFunc blitfun;
/* Set up data for choosing the blit */
srcfmt = surface->format;
dstfmt = surface->map->dst->format;
/* We don't support destinations less than 8-bits */
if (dstfmt->BitsPerPixel < 8) {
return (NULL);
}
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
case 0:
blitfun = NULL;
if (dstfmt->BitsPerPixel == 8) {
if ((srcfmt->BytesPerPixel == 4) &&
(srcfmt->Rmask == 0x00FF0000) &&
(srcfmt->Gmask == 0x0000FF00) &&
(srcfmt->Bmask == 0x000000FF)) {
blitfun = Blit_RGB888_index8;
} else if ((srcfmt->BytesPerPixel == 4) &&
(srcfmt->Rmask == 0x3FF00000) &&
(srcfmt->Gmask == 0x000FFC00) &&
(srcfmt->Bmask == 0x000003FF)) {
blitfun = Blit_RGB101010_index8;
} else {
blitfun = BlitNto1;
}
} else {
/* Now the meat, choose the blitter we want */
int a_need = NO_ALPHA;
if (dstfmt->Amask)
a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
table = normal_blit[srcfmt->BytesPerPixel - 1];
for (which = 0; table[which].dstbpp; ++which) {
if (MASKOK(srcfmt->Rmask, table[which].srcR) &&
MASKOK(srcfmt->Gmask, table[which].srcG) &&
MASKOK(srcfmt->Bmask, table[which].srcB) &&
MASKOK(dstfmt->Rmask, table[which].dstR) &&
MASKOK(dstfmt->Gmask, table[which].dstG) &&
MASKOK(dstfmt->Bmask, table[which].dstB) &&
dstfmt->BytesPerPixel == table[which].dstbpp &&
(a_need & table[which].alpha) == a_need &&
((table[which].blit_features & GetBlitFeatures()) ==
table[which].blit_features))
break;
}
blitfun = table[which].blitfunc;
if (blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */
if (srcfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
blitfun = Blit2101010toN;
} else if (dstfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
blitfun = BlitNto2101010;
} else if (srcfmt->BytesPerPixel == 4 &&
dstfmt->BytesPerPixel == 4 &&
srcfmt->Rmask == dstfmt->Rmask &&
srcfmt->Gmask == dstfmt->Gmask &&
srcfmt->Bmask == dstfmt->Bmask) {
if (a_need == COPY_ALPHA) {
if (srcfmt->Amask == dstfmt->Amask) {
/* Fastpath C fallback: 32bit RGBA<->RGBA blit with matching RGBA */
blitfun = Blit4to4CopyAlpha;
} else {
blitfun = BlitNtoNCopyAlpha;
}
} else {
/* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
blitfun = Blit4to4MaskAlpha;
}
} else if (a_need == COPY_ALPHA) {
blitfun = BlitNtoNCopyAlpha;
}
}
}
return (blitfun);
case SDL_COPY_COLORKEY:
/* colorkey blit: Here we don't have too many options, mostly
because RLE is the preferred fast way to deal with this.
If a particular case turns out to be useful we'll add it. */
if (srcfmt->BytesPerPixel == 2 && surface->map->identity)
return Blit2to2Key;
else if (dstfmt->BytesPerPixel == 1)
return BlitNto1Key;
else {
#if SDL_ALTIVEC_BLITTERS
if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4)
&& SDL_HasAltiVec()) {
return Blit32to32KeyAltivec;
} else
#endif
if (srcfmt->Amask && dstfmt->Amask) {
return BlitNtoNKeyCopyAlpha;
} else {
return BlitNtoNKey;
}
}
}
return NULL;
}
blit_table::blitfunc
SDL_BlitFunc blitfunc
Definition: SDL_blit_N.c:2464
blit_table::alpha
enum blit_table::@28 alpha
SDL_HasAltiVec
#define SDL_HasAltiVec
Definition: SDL_dynapi_overrides.h:110
blit_table::srcG
Uint32 srcG
Definition: SDL_blit_N.c:2460
blit_table::srcB
Uint32 srcB
Definition: SDL_blit_N.c:2460
MASKOK
#define MASKOK(x, y)
Definition: SDL_blit_N.c:2524
SDL_PIXELFORMAT_ARGB2101010
Definition: SDL_pixels.h:259
table
GLenum GLsizei GLenum GLenum const void * table
Definition: SDL_opengl_glext.h:3118
SDL_COPY_COLORKEY
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:39
blit_table::blit_features
Uint32 blit_features
Definition: SDL_blit_N.c:2463
SDL_PixelFormat::Gmask
Uint32 Gmask
Definition: SDL_pixels.h:307
blit_table::SET_ALPHA
Definition: SDL_blit_N.c:2466
blit_table::dstB
Uint32 dstB
Definition: SDL_blit_N.c:2462
blit_table::dstR
Uint32 dstR
Definition: SDL_blit_N.c:2462
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:304
SDL_BlitInfo::flags
int flags
Definition: SDL_blit.h:68
BlitNto2101010
static void BlitNto2101010(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2427
SDL_PixelFormat::Bmask
Uint32 Bmask
Definition: SDL_pixels.h:308
SDL_COPY_RLE_MASK
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:44
blit_table::dstbpp
int dstbpp
Definition: SDL_blit_N.c:2461
blit_table::srcR
Uint32 srcR
Definition: SDL_blit_N.c:2460
BlitNtoNCopyAlpha
static void BlitNtoNCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2180
SDL_Surface::map
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
blit_table::dstG
Uint32 dstG
Definition: SDL_blit_N.c:2462
Blit2to2Key
static void Blit2to2Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2275
SDL_PixelFormat::BitsPerPixel
Uint8 BitsPerPixel
Definition: SDL_pixels.h:303
Blit4to4MaskAlpha
static void Blit4to4MaskAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2069
BlitNto1Key
static void BlitNto1Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2209
Blit_RGB888_index8
static void Blit_RGB888_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:893
blit_table::NO_ALPHA
Definition: SDL_blit_N.c:2466
blit_table
Definition: SDL_blit_N.c:2458
blit_table::COPY_ALPHA
Definition: SDL_blit_N.c:2466
SDL_BlitMap::dst
SDL_Surface * dst
Definition: SDL_blit.h:87
NULL
#define NULL
Definition: begin_code.h:143
SDL_Surface::format
SDL_PixelFormat * format
Definition: SDL_surface.h:72
normal_blit
static const struct blit_table *const normal_blit[]
Definition: SDL_blit_N.c:2519
BlitNtoNKey
static void BlitNtoNKey(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2309
Blit2101010toN
static void Blit2101010toN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2395
SDL_PixelFormat::Rmask
Uint32 Rmask
Definition: SDL_pixels.h:306
BlitNtoNKeyCopyAlpha
static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2352
GetBlitFeatures
#define GetBlitFeatures()
Definition: SDL_blit_N.c:874
SDL_PixelFormat
Definition: SDL_pixels.h:299
SDL_BlitFunc
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:73
Blit_RGB101010_index8
static void Blit_RGB101010_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1003
Blit4to4CopyAlpha
static void Blit4to4CopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2119
BlitNtoN
static void BlitNtoN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2145
SDL_PixelFormat::Amask
Uint32 Amask
Definition: SDL_pixels.h:309
SDL_PixelFormat::format
Uint32 format
Definition: SDL_pixels.h:301
SDL_BlitMap::identity
int identity
Definition: SDL_blit.h:88
SDL_BlitMap::info
SDL_BlitInfo info
Definition: SDL_blit.h:91
BlitNto1
static void BlitNto1(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1974

## Variable Documentation

Uint8* SDL_expand_byte[9]

Definition at line 71 of file SDL_pixels.c.

Referenced by SDL_GetRGB(), and SDL_GetRGBA().