SDL_blit_N.c File Reference
`#include "../SDL_internal.h"`
`#include "SDL_video.h"`
`#include "SDL_endian.h"`
`#include "SDL_cpuinfo.h"`
`#include "SDL_blit.h"`
`#include "SDL_assert.h"`
Include dependency graph for SDL_blit_N.c:

Go to the source code of this file.

## Data Structures

struct | blit_table

## Macros

#define | HAVE_FAST_WRITE_INT8 1
#define | GetBlitFeatures() ((Uint32)(SDL_HasMMX() ? 1 : 0))
#define | HI 1
#define | LO 0
#define | RGB888_RGB332(dst, src)
#define | RGB101010_RGB332(dst, src)
#define | RGB888_RGB555(dst, src)
#define | RGB888_RGB565(dst, src)
#define | RGB565_32(dst, src, map) (map[src[LO]*2] + map[src[HI]*2+1])
#define | NO_ALPHA 1
#define | SET_ALPHA 2
#define | COPY_ALPHA 4
#define | MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000))

## Functions

static void | Blit_RGB888_index8 (SDL_BlitInfo *info)
static void | Blit_RGB101010_index8 (SDL_BlitInfo *info)
static void | Blit_RGB888_RGB555 (SDL_BlitInfo *info)
static void | Blit_RGB888_RGB565 (SDL_BlitInfo *info)
static void | Blit_RGB565_32 (SDL_BlitInfo *info, const Uint32 *map)
static void | Blit_RGB565_ARGB8888 (SDL_BlitInfo *info)
static void | Blit_RGB565_ABGR8888 (SDL_BlitInfo *info)
static void | Blit_RGB565_RGBA8888 (SDL_BlitInfo *info)
static void | Blit_RGB565_BGRA8888 (SDL_BlitInfo *info)
static void | BlitNto1 (SDL_BlitInfo *info)
static void | Blit4to4MaskAlpha (SDL_BlitInfo *info)
static void | Blit4to4CopyAlpha (SDL_BlitInfo *info)
static void | get_permutation (SDL_PixelFormat *srcfmt, SDL_PixelFormat *dstfmt, int *_p0, int *_p1, int *_p2, int *_p3, int *_alpha_channel)
static void | BlitNtoN (SDL_BlitInfo *info)
static void | BlitNtoNCopyAlpha (SDL_BlitInfo *info)
static void | BlitNto1Key (SDL_BlitInfo *info)
static void | Blit2to2Key (SDL_BlitInfo *info)
static void | BlitNtoNKey (SDL_BlitInfo *info)
static void | BlitNtoNKeyCopyAlpha (SDL_BlitInfo *info)
static void | Blit2101010toN (SDL_BlitInfo *info)
static void | BlitNto2101010 (SDL_BlitInfo *info)
static void | Blit_3or4_to_3or4__same_rgb (SDL_BlitInfo *info)
static void | Blit_3or4_to_3or4__inversed_rgb (SDL_BlitInfo *info)
SDL_BlitFunc | SDL_CalculateBlitN (SDL_Surface *surface)

## Variables

static const Uint32 | RGB565_ARGB8888_LUT [512]
static const Uint32 | RGB565_ABGR8888_LUT [512]
static const Uint32 | RGB565_RGBA8888_LUT [512]
static const Uint32 | RGB565_BGRA8888_LUT [512]
static const struct blit_table | normal_blit_1 []
static const struct blit_table | normal_blit_2 []
static const struct blit_table | normal_blit_3 []
static const struct blit_table | normal_blit_4 []
static const struct blit_table *const | normal_blit []

## Macro Definition Documentation

## COPY_ALPHA

#define COPY_ALPHA 4

Definition at line 3142 of file SDL_blit_N.c.

## GetBlitFeatures

#define GetBlitFeatures | ( |  | ) | ((Uint32)(SDL_HasMMX() ? 1 : 0))

Definition at line 887 of file SDL_blit_N.c.

## HAVE_FAST_WRITE_INT8

#define HAVE_FAST_WRITE_INT8 1

Definition at line 31 of file SDL_blit_N.c.

## HI

#define HI 1

Definition at line 892 of file SDL_blit_N.c.

## LO

#define LO 0

Definition at line 893 of file SDL_blit_N.c.

## MASKOK

#define MASKOK | ( |  | x,
|  |  | y
| ) |  | (((x) == (y)) || ((y) == 0x00000000))

Definition at line 3263 of file SDL_blit_N.c.

## NO_ALPHA

#define NO_ALPHA 1

Definition at line 3140 of file SDL_blit_N.c.

## RGB101010_RGB332

#define RGB101010_RGB332 | ( |  | dst,
|  |  | src
| ) |  |

Value:
{ \
dst = (Uint8)((((src)&0x38000000)>>22)| \
(((src)&0x000E0000)>>15)| \
(((src)&0x00000300)>>8)); \
}

Definition at line 1010 of file SDL_blit_N.c.

## RGB565_32

#define RGB565_32 | ( |  | dst,
|  |  | src,
|  |  | map
| ) |  | (map[src[LO]*2] + map[src[HI]*2+1])

Definition at line 1373 of file SDL_blit_N.c.

## RGB888_RGB332

#define RGB888_RGB332 | ( |  | dst,
|  |  | src
| ) |  |

Value:
{ \
dst = (Uint8)((((src)&0x00E00000)>>16)| \
(((src)&0x0000E000)>>11)| \
(((src)&0x000000C0)>>6)); \
}

Definition at line 900 of file SDL_blit_N.c.

## RGB888_RGB555

#define RGB888_RGB555 | ( |  | dst,
|  |  | src
| ) |  |

Value:
{ \
*(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>9)| \
(((*src)&0x0000F800)>>6)| \
(((*src)&0x000000F8)>>3)); \
}

Definition at line 1120 of file SDL_blit_N.c.

## RGB888_RGB565

#define RGB888_RGB565 | ( |  | dst,
|  |  | src
| ) |  |

Value:
{ \
*(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \
(((*src)&0x0000FC00)>>5)| \
(((*src)&0x000000F8)>>3)); \
}

Definition at line 1246 of file SDL_blit_N.c.

## SET_ALPHA

#define SET_ALPHA 2

Definition at line 3141 of file SDL_blit_N.c.

## Function Documentation

## Blit2101010toN()

static void Blit2101010toN | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2897 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint8 *src = info->src;
int srcskip = info->src_skip;
Uint8 *dst = info->dst;
int dstskip = info->dst_skip;
SDL_PixelFormat *dstfmt = info->dst_fmt;
int dstbpp = dstfmt->BytesPerPixel;
Uint32 Pixel;
unsigned sR, sG, sB, sA;
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Pixel = *(Uint32 *)src;
RGBA_FROM_ARGB2101010(Pixel, sR, sG, sB, sA);
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
dst += dstbpp;
src += 4;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
}

References ASSEMBLE_RGBA, SDL_PixelFormat::BytesPerPixel, SDL_BlitInfo::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, RGBA_FROM_ARGB2101010, SDL_BlitInfo::src, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

## Blit2to2Key()

static void Blit2to2Key | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2487 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint16 *srcp = (Uint16 *) info->src;
int srcskip = info->src_skip;
Uint16 *dstp = (Uint16 *) info->dst;
int dstskip = info->dst_skip;
Uint32 ckey = info->colorkey;
Uint32 rgbmask = ~info->src_fmt->Amask;
/* Set up some basic variables */
srcskip /= 2;
dstskip /= 2;
ckey &= rgbmask;
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
if ( (*srcp & rgbmask) != ckey ) {
*dstp = *srcp;
}
dstp++;
srcp++;
},
width);
/* *INDENT-ON* */
srcp += srcskip;
dstp += dstskip;
}
}

References SDL_PixelFormat::Amask, SDL_BlitInfo::colorkey, SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

## Blit4to4CopyAlpha()

static void Blit4to4CopyAlpha | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2136 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint32 *src = (Uint32 *) info->src;
int srcskip = info->src_skip;
Uint32 *dst = (Uint32 *) info->dst;
int dstskip = info->dst_skip;
/* RGBA->RGBA, COPY_ALPHA */
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
*dst = *src;
++dst;
++src;
},
width);
/* *INDENT-ON* */
src = (Uint32 *) ((Uint8 *) src + srcskip);
dst = (Uint32 *) ((Uint8 *) dst + dstskip);
}
}

References SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, SDL_BlitInfo::src, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

## Blit4to4MaskAlpha()

static void Blit4to4MaskAlpha | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2086 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint32 *src = (Uint32 *) info->src;
int srcskip = info->src_skip;
Uint32 *dst = (Uint32 *) info->dst;
int dstskip = info->dst_skip;
SDL_PixelFormat *srcfmt = info->src_fmt;
SDL_PixelFormat *dstfmt = info->dst_fmt;
if (dstfmt->Amask) {
/* RGB->RGBA, SET_ALPHA */
Uint32 mask = (info->a >> dstfmt->Aloss) << dstfmt->Ashift;
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
*dst = *src | mask;
++dst;
++src;
},
width);
/* *INDENT-ON* */
src = (Uint32 *) ((Uint8 *) src + srcskip);
dst = (Uint32 *) ((Uint8 *) dst + dstskip);
}
} else {
/* RGBA->RGB, NO_ALPHA */
Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
*dst = *src & mask;
++dst;
++src;
},
width);
/* *INDENT-ON* */
src = (Uint32 *) ((Uint8 *) src + srcskip);
dst = (Uint32 *) ((Uint8 *) dst + dstskip);
}
}
}

References SDL_BlitInfo::a, SDL_PixelFormat::Aloss, SDL_PixelFormat::Amask, SDL_PixelFormat::Ashift, SDL_PixelFormat::Bmask, SDL_BlitInfo::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, SDL_PixelFormat::Gmask, SDL_PixelFormat::Rmask, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

## Blit_3or4_to_3or4__inversed_rgb()

static void Blit_3or4_to_3or4__inversed_rgb | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 3036 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint8 *src = info->src;
int srcskip = info->src_skip;
Uint8 *dst = info->dst;
int dstskip = info->dst_skip;
SDL_PixelFormat *srcfmt = info->src_fmt;
int srcbpp = srcfmt->BytesPerPixel;
SDL_PixelFormat *dstfmt = info->dst_fmt;
int dstbpp = dstfmt->BytesPerPixel;
if (dstfmt->Amask) {
if (srcfmt->Amask) {
/* COPY_ALPHA */
/* Only to switch ABGR8888 <-> ARGB8888 */
while (height--) {
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
int i0 = 0, i1 = 1, i2 = 2, i3 = 3;
#else
int i0 = 3, i1 = 2, i2 = 1, i3 = 0;
#endif
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint32 *dst32 = (Uint32*)dst;
Uint8 s0 = src[i0];
Uint8 s1 = src[i1];
Uint8 s2 = src[i2];
Uint32 alphashift = src[i3] << dstfmt->Ashift;
/* inversed, compared to Blit_3or4_to_3or4__same_rgb */
*dst32 = (s0 << 16) | (s1 << 8) | (s2) | alphashift;
dst += 4;
src += 4;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
} else {
/* SET_ALPHA */
Uint32 mask = info->a << dstfmt->Ashift;
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
int i0 = 0, i1 = 1, i2 = 2;
#else
int i0 = srcbpp - 1 - 0;
int i1 = srcbpp - 1 - 1;
int i2 = srcbpp - 1 - 2;
#endif
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint32 *dst32 = (Uint32*)dst;
Uint8 s0 = src[i0];
Uint8 s1 = src[i1];
Uint8 s2 = src[i2];
/* inversed, compared to Blit_3or4_to_3or4__same_rgb */
*dst32 = (s0 << 16) | (s1 << 8) | (s2) | mask;
dst += 4;
src += srcbpp;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
}
} else {
/* NO_ALPHA */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
int i0 = 0, i1 = 1, i2 = 2;
int j0 = 2, j1 = 1, j2 = 0;
#else
int i0 = srcbpp - 1 - 0;
int i1 = srcbpp - 1 - 1;
int i2 = srcbpp - 1 - 2;
int j0 = dstbpp - 1 - 2;
int j1 = dstbpp - 1 - 1;
int j2 = dstbpp - 1 - 0;
#endif
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint8 s0 = src[i0];
Uint8 s1 = src[i1];
Uint8 s2 = src[i2];
/* inversed, compared to Blit_3or4_to_3or4__same_rgb */
dst[j0] = s0;
dst[j1] = s1;
dst[j2] = s2;
dst += dstbpp;
src += srcbpp;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
}
return;
}

References SDL_BlitInfo::a, SDL_PixelFormat::Amask, SDL_PixelFormat::Ashift, SDL_PixelFormat::BytesPerPixel, SDL_BlitInfo::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, i1, i2, j1, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

## Blit_3or4_to_3or4__same_rgb()

static void Blit_3or4_to_3or4__same_rgb | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2961 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint8 *src = info->src;
int srcskip = info->src_skip;
Uint8 *dst = info->dst;
int dstskip = info->dst_skip;
SDL_PixelFormat *srcfmt = info->src_fmt;
int srcbpp = srcfmt->BytesPerPixel;
SDL_PixelFormat *dstfmt = info->dst_fmt;
int dstbpp = dstfmt->BytesPerPixel;
if (dstfmt->Amask) {
/* SET_ALPHA */
Uint32 mask = info->a << dstfmt->Ashift;
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
int i0 = 0, i1 = 1, i2 = 2;
#else
int i0 = srcbpp - 1 - 0;
int i1 = srcbpp - 1 - 1;
int i2 = srcbpp - 1 - 2;
#endif
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint32 *dst32 = (Uint32*)dst;
Uint8 s0 = src[i0];
Uint8 s1 = src[i1];
Uint8 s2 = src[i2];
*dst32 = (s0) | (s1 << 8) | (s2 << 16) | mask;
dst += 4;
src += srcbpp;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
} else {
/* NO_ALPHA */
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
int i0 = 0, i1 = 1, i2 = 2;
int j0 = 0, j1 = 1, j2 = 2;
#else
int i0 = srcbpp - 1 - 0;
int i1 = srcbpp - 1 - 1;
int i2 = srcbpp - 1 - 2;
int j0 = dstbpp - 1 - 0;
int j1 = dstbpp - 1 - 1;
int j2 = dstbpp - 1 - 2;
#endif
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint8 s0 = src[i0];
Uint8 s1 = src[i1];
Uint8 s2 = src[i2];
dst[j0] = s0;
dst[j1] = s1;
dst[j2] = s2;
dst += dstbpp;
src += srcbpp;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
}
return;
}

References SDL_BlitInfo::a, SDL_PixelFormat::Amask, SDL_PixelFormat::Ashift, SDL_PixelFormat::BytesPerPixel, SDL_BlitInfo::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, i1, i2, j1, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

## Blit_RGB101010_index8()

static void Blit_RGB101010_index8 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 1016 of file SDL_blit_N.c.

{
#ifndef USE_DUFFS_LOOP
int c;
#endif
int width, height;
Uint32 *src;
const Uint8 *map;
Uint8 *dst;
int srcskip, dstskip;
/* Set up some basic variables */
width = info->dst_w;
height = info->dst_h;
src = (Uint32 *) info->src;
srcskip = info->src_skip / 4;
dst = info->dst;
dstskip = info->dst_skip;
map = info->table;
if (map == NULL) {
while (height--) {
#ifdef USE_DUFFS_LOOP
/* *INDENT-OFF* */
DUFFS_LOOP(
RGB101010_RGB332(*dst++, *src);
, width);
/* *INDENT-ON* */
#else
for (c = width / 4; c; --c) {
/* Pack RGB into 8bit pixel */
++src;
RGB101010_RGB332(*dst++, *src);
++src;
RGB101010_RGB332(*dst++, *src);
++src;
RGB101010_RGB332(*dst++, *src);
++src;
}
switch (width & 3) {
case 3:
RGB101010_RGB332(*dst++, *src);
++src;
case 2:
RGB101010_RGB332(*dst++, *src);
++src;
case 1:
RGB101010_RGB332(*dst++, *src);
++src;
}
#endif /* USE_DUFFS_LOOP */
src += srcskip;
dst += dstskip;
}
} else {
int Pixel;
while (height--) {
#ifdef USE_DUFFS_LOOP
/* *INDENT-OFF* */
DUFFS_LOOP(
RGB101010_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
, width);
/* *INDENT-ON* */
#else
for (c = width / 4; c; --c) {
/* Pack RGB into 8bit pixel */
RGB101010_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
RGB101010_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
RGB101010_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
RGB101010_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
}
switch (width & 3) {
case 3:
RGB101010_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
case 2:
RGB101010_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
case 1:
RGB101010_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
}
#endif /* USE_DUFFS_LOOP */
src += srcskip;
dst += dstskip;
}
}
}

References SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, map, NULL, RGB101010_RGB332, SDL_BlitInfo::src, SDL_BlitInfo::src_skip, and SDL_BlitInfo::table.

Referenced by SDL_CalculateBlitN().

## Blit_RGB565_32()

static void Blit_RGB565_32 | ( | SDL_BlitInfo * | info,
|  | const Uint32 * | map
| ) |  |

static

Definition at line 1375 of file SDL_blit_N.c.

{
#ifndef USE_DUFFS_LOOP
int c;
#endif
int width, height;
Uint8 *src;
Uint32 *dst;
int srcskip, dstskip;
/* Set up some basic variables */
width = info->dst_w;
height = info->dst_h;
src = (Uint8 *) info->src;
srcskip = info->src_skip;
dst = (Uint32 *) info->dst;
dstskip = info->dst_skip / 4;
#ifdef USE_DUFFS_LOOP
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
*dst++ = RGB565_32(dst, src, map);
src += 2;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
#else
while (height--) {
/* Copy in 4 pixel chunks */
for (c = width / 4; c; --c) {
*dst++ = RGB565_32(dst, src, map);
src += 2;
*dst++ = RGB565_32(dst, src, map);
src += 2;
*dst++ = RGB565_32(dst, src, map);
src += 2;
*dst++ = RGB565_32(dst, src, map);
src += 2;
}
/* Get any leftovers */
switch (width & 3) {
case 3:
*dst++ = RGB565_32(dst, src, map);
src += 2;
case 2:
*dst++ = RGB565_32(dst, src, map);
src += 2;
case 1:
*dst++ = RGB565_32(dst, src, map);
src += 2;
break;
}
src += srcskip;
dst += dstskip;
}
#endif /* USE_DUFFS_LOOP */
}

References SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, map, RGB565_32, SDL_BlitInfo::src, and SDL_BlitInfo::src_skip.

Referenced by Blit_RGB565_ABGR8888(), Blit_RGB565_ARGB8888(), Blit_RGB565_BGRA8888(), and Blit_RGB565_RGBA8888().

## Blit_RGB565_ABGR8888()

static void Blit_RGB565_ABGR8888 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 1709 of file SDL_blit_N.c.

{
Blit_RGB565_32(info, RGB565_ABGR8888_LUT);
}

References Blit_RGB565_32(), and RGB565_ABGR8888_LUT.

## Blit_RGB565_ARGB8888()

static void Blit_RGB565_ARGB8888 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 1571 of file SDL_blit_N.c.

{
Blit_RGB565_32(info, RGB565_ARGB8888_LUT);
}

References Blit_RGB565_32(), and RGB565_ARGB8888_LUT.

## Blit_RGB565_BGRA8888()

static void Blit_RGB565_BGRA8888 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 1985 of file SDL_blit_N.c.

{
Blit_RGB565_32(info, RGB565_BGRA8888_LUT);
}

References Blit_RGB565_32(), and RGB565_BGRA8888_LUT.

## Blit_RGB565_RGBA8888()

static void Blit_RGB565_RGBA8888 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 1847 of file SDL_blit_N.c.

{
Blit_RGB565_32(info, RGB565_RGBA8888_LUT);
}

References Blit_RGB565_32(), and RGB565_RGBA8888_LUT.

## Blit_RGB888_index8()

static void Blit_RGB888_index8 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 906 of file SDL_blit_N.c.

{
#ifndef USE_DUFFS_LOOP
int c;
#endif
int width, height;
Uint32 *src;
const Uint8 *map;
Uint8 *dst;
int srcskip, dstskip;
/* Set up some basic variables */
width = info->dst_w;
height = info->dst_h;
src = (Uint32 *) info->src;
srcskip = info->src_skip / 4;
dst = info->dst;
dstskip = info->dst_skip;
map = info->table;
if (map == NULL) {
while (height--) {
#ifdef USE_DUFFS_LOOP
/* *INDENT-OFF* */
DUFFS_LOOP(
RGB888_RGB332(*dst++, *src);
, width);
/* *INDENT-ON* */
#else
for (c = width / 4; c; --c) {
/* Pack RGB into 8bit pixel */
++src;
RGB888_RGB332(*dst++, *src);
++src;
RGB888_RGB332(*dst++, *src);
++src;
RGB888_RGB332(*dst++, *src);
++src;
}
switch (width & 3) {
case 3:
RGB888_RGB332(*dst++, *src);
++src;
case 2:
RGB888_RGB332(*dst++, *src);
++src;
case 1:
RGB888_RGB332(*dst++, *src);
++src;
}
#endif /* USE_DUFFS_LOOP */
src += srcskip;
dst += dstskip;
}
} else {
int Pixel;
while (height--) {
#ifdef USE_DUFFS_LOOP
/* *INDENT-OFF* */
DUFFS_LOOP(
RGB888_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
, width);
/* *INDENT-ON* */
#else
for (c = width / 4; c; --c) {
/* Pack RGB into 8bit pixel */
RGB888_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
RGB888_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
RGB888_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
RGB888_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
}
switch (width & 3) {
case 3:
RGB888_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
case 2:
RGB888_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
case 1:
RGB888_RGB332(Pixel, *src);
*dst++ = map[Pixel];
++src;
}
#endif /* USE_DUFFS_LOOP */
src += srcskip;
dst += dstskip;
}
}
}

References SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, map, NULL, RGB888_RGB332, SDL_BlitInfo::src, SDL_BlitInfo::src_skip, and SDL_BlitInfo::table.

Referenced by SDL_CalculateBlitN().

## Blit_RGB888_RGB555()

static void Blit_RGB888_RGB555 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 1136 of file SDL_blit_N.c.

{
#ifndef USE_DUFFS_LOOP
int c;
#endif
int width, height;
Uint32 *src;
Uint16 *dst;
int srcskip, dstskip;
/* Set up some basic variables */
width = info->dst_w;
height = info->dst_h;
src = (Uint32 *) info->src;
srcskip = info->src_skip / 4;
dst = (Uint16 *) info->dst;
dstskip = info->dst_skip / 2;
#ifdef USE_DUFFS_LOOP
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
RGB888_RGB555(dst, src);
++src;
++dst;
, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
#else
/* Memory align at 4-byte boundary, if necessary */
if ((long) dst & 0x03) {
/* Don't do anything if width is 0 */
if (width == 0) {
return;
}
--width;
while (height--) {
/* Perform copy alignment */
RGB888_RGB555(dst, src);
++src;
++dst;
/* Copy in 4 pixel chunks */
for (c = width / 4; c; --c) {
RGB888_RGB555_TWO(dst, src);
src += 2;
dst += 2;
RGB888_RGB555_TWO(dst, src);
src += 2;
dst += 2;
}
/* Get any leftovers */
switch (width & 3) {
case 3:
RGB888_RGB555(dst, src);
++src;
++dst;
case 2:
RGB888_RGB555_TWO(dst, src);
src += 2;
dst += 2;
break;
case 1:
RGB888_RGB555(dst, src);
++src;
++dst;
break;
}
src += srcskip;
dst += dstskip;
}
} else {
while (height--) {
/* Copy in 4 pixel chunks */
for (c = width / 4; c; --c) {
RGB888_RGB555_TWO(dst, src);
src += 2;
dst += 2;
RGB888_RGB555_TWO(dst, src);
src += 2;
dst += 2;
}
/* Get any leftovers */
switch (width & 3) {
case 3:
RGB888_RGB555(dst, src);
++src;
++dst;
case 2:
RGB888_RGB555_TWO(dst, src);
src += 2;
dst += 2;
break;
case 1:
RGB888_RGB555(dst, src);
++src;
++dst;
break;
}
src += srcskip;
dst += dstskip;
}
}
#endif /* USE_DUFFS_LOOP */
}

References SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, RGB888_RGB555, SDL_BlitInfo::src, and SDL_BlitInfo::src_skip.

## Blit_RGB888_RGB565()

static void Blit_RGB888_RGB565 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 1262 of file SDL_blit_N.c.

{
#ifndef USE_DUFFS_LOOP
int c;
#endif
int width, height;
Uint32 *src;
Uint16 *dst;
int srcskip, dstskip;
/* Set up some basic variables */
width = info->dst_w;
height = info->dst_h;
src = (Uint32 *) info->src;
srcskip = info->src_skip / 4;
dst = (Uint16 *) info->dst;
dstskip = info->dst_skip / 2;
#ifdef USE_DUFFS_LOOP
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
RGB888_RGB565(dst, src);
++src;
++dst;
, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
#else
/* Memory align at 4-byte boundary, if necessary */
if ((long) dst & 0x03) {
/* Don't do anything if width is 0 */
if (width == 0) {
return;
}
--width;
while (height--) {
/* Perform copy alignment */
RGB888_RGB565(dst, src);
++src;
++dst;
/* Copy in 4 pixel chunks */
for (c = width / 4; c; --c) {
RGB888_RGB565_TWO(dst, src);
src += 2;
dst += 2;
RGB888_RGB565_TWO(dst, src);
src += 2;
dst += 2;
}
/* Get any leftovers */
switch (width & 3) {
case 3:
RGB888_RGB565(dst, src);
++src;
++dst;
case 2:
RGB888_RGB565_TWO(dst, src);
src += 2;
dst += 2;
break;
case 1:
RGB888_RGB565(dst, src);
++src;
++dst;
break;
}
src += srcskip;
dst += dstskip;
}
} else {
while (height--) {
/* Copy in 4 pixel chunks */
for (c = width / 4; c; --c) {
RGB888_RGB565_TWO(dst, src);
src += 2;
dst += 2;
RGB888_RGB565_TWO(dst, src);
src += 2;
dst += 2;
}
/* Get any leftovers */
switch (width & 3) {
case 3:
RGB888_RGB565(dst, src);
++src;
++dst;
case 2:
RGB888_RGB565_TWO(dst, src);
src += 2;
dst += 2;
break;
case 1:
RGB888_RGB565(dst, src);
++src;
++dst;
break;
}
src += srcskip;
dst += dstskip;
}
}
#endif /* USE_DUFFS_LOOP */
}

References SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, RGB888_RGB565, SDL_BlitInfo::src, and SDL_BlitInfo::src_skip.

## BlitNto1()

static void BlitNto1 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 1991 of file SDL_blit_N.c.

{
#ifndef USE_DUFFS_LOOP
int c;
#endif
int width, height;
Uint8 *src;
const Uint8 *map;
Uint8 *dst;
int srcskip, dstskip;
int srcbpp;
Uint32 Pixel;
int sR, sG, sB;
SDL_PixelFormat *srcfmt;
/* Set up some basic variables */
width = info->dst_w;
height = info->dst_h;
src = info->src;
srcskip = info->src_skip;
dst = info->dst;
dstskip = info->dst_skip;
map = info->table;
srcfmt = info->src_fmt;
srcbpp = srcfmt->BytesPerPixel;
if (map == NULL) {
while (height--) {
#ifdef USE_DUFFS_LOOP
/* *INDENT-OFF* */
DUFFS_LOOP(
DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
sR, sG, sB);
if ( 1 ) {
/* Pack RGB into 8bit pixel */
*dst = ((sR>>5)<<(3+2))|
((sG>>5)<<(2)) |
((sB>>6)<<(0)) ;
}
dst++;
src += srcbpp;
, width);
/* *INDENT-ON* */
#else
for (c = width; c; --c) {
DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
if (1) {
/* Pack RGB into 8bit pixel */
*dst = ((sR >> 5) << (3 + 2)) |
((sG >> 5) << (2)) | ((sB >> 6) << (0));
}
dst++;
src += srcbpp;
}
#endif
src += srcskip;
dst += dstskip;
}
} else {
while (height--) {
#ifdef USE_DUFFS_LOOP
/* *INDENT-OFF* */
DUFFS_LOOP(
DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
sR, sG, sB);
if ( 1 ) {
/* Pack RGB into 8bit pixel */
*dst = map[((sR>>5)<<(3+2))|
((sG>>5)<<(2)) |
((sB>>6)<<(0)) ];
}
dst++;
src += srcbpp;
, width);
/* *INDENT-ON* */
#else
for (c = width; c; --c) {
DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
if (1) {
/* Pack RGB into 8bit pixel */
*dst = map[((sR >> 5) << (3 + 2)) |
((sG >> 5) << (2)) | ((sB >> 6) << (0))];
}
dst++;
src += srcbpp;
}
#endif /* USE_DUFFS_LOOP */
src += srcskip;
dst += dstskip;
}
}
}

References SDL_PixelFormat::BytesPerPixel, DISEMBLE_RGB, SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, map, NULL, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, SDL_BlitInfo::src_skip, and SDL_BlitInfo::table.

Referenced by SDL_CalculateBlitN().

## BlitNto1Key()

static void BlitNto1Key | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2421 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint8 *src = info->src;
int srcskip = info->src_skip;
Uint8 *dst = info->dst;
int dstskip = info->dst_skip;
SDL_PixelFormat *srcfmt = info->src_fmt;
const Uint8 *palmap = info->table;
Uint32 ckey = info->colorkey;
Uint32 rgbmask = ~srcfmt->Amask;
int srcbpp;
Uint32 Pixel;
unsigned sR, sG, sB;
/* Set up some basic variables */
srcbpp = srcfmt->BytesPerPixel;
ckey &= rgbmask;
if (palmap == NULL) {
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
sR, sG, sB);
if ( (Pixel & rgbmask) != ckey ) {
/* Pack RGB into 8bit pixel */
*dst = (Uint8)(((sR>>5)<<(3+2))|
((sG>>5)<<(2)) |
((sB>>6)<<(0)));
}
dst++;
src += srcbpp;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
} else {
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
sR, sG, sB);
if ( (Pixel & rgbmask) != ckey ) {
/* Pack RGB into 8bit pixel */
*dst = (Uint8)palmap[((sR>>5)<<(3+2))|
((sG>>5)<<(2)) |
((sB>>6)<<(0)) ];
}
dst++;
src += srcbpp;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
}
}

References SDL_PixelFormat::Amask, SDL_PixelFormat::BytesPerPixel, SDL_BlitInfo::colorkey, DISEMBLE_RGB, SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, NULL, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, SDL_BlitInfo::src_skip, and SDL_BlitInfo::table.

Referenced by SDL_CalculateBlitN().

## BlitNto2101010()

static void BlitNto2101010 | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2929 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint8 *src = info->src;
int srcskip = info->src_skip;
Uint8 *dst = info->dst;
int dstskip = info->dst_skip;
SDL_PixelFormat *srcfmt = info->src_fmt;
int srcbpp = srcfmt->BytesPerPixel;
Uint32 Pixel;
unsigned sR, sG, sB, sA;
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
ARGB2101010_FROM_RGBA(Pixel, sR, sG, sB, sA);
*(Uint32 *)dst = Pixel;
dst += 4;
src += srcbpp;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
}

References ARGB2101010_FROM_RGBA, SDL_PixelFormat::BytesPerPixel, DISEMBLE_RGBA, SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

## BlitNtoN()

static void BlitNtoN | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2244 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint8 *src = info->src;
int srcskip = info->src_skip;
Uint8 *dst = info->dst;
int dstskip = info->dst_skip;
SDL_PixelFormat *srcfmt = info->src_fmt;
int srcbpp = srcfmt->BytesPerPixel;
SDL_PixelFormat *dstfmt = info->dst_fmt;
int dstbpp = dstfmt->BytesPerPixel;
unsigned alpha = dstfmt->Amask ? info->a : 0;
#if HAVE_FAST_WRITE_INT8
/* Blit with permutation: 4->4 */
if (srcbpp == 4 && dstbpp == 4 &&
srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
/* Find the appropriate permutation */
int alpha_channel, p0, p1, p2, p3;
get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, &alpha_channel);
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
dst[0] = src[p0];
dst[1] = src[p1];
dst[2] = src[p2];
dst[3] = src[p3];
dst[alpha_channel] = alpha;
src += 4;
dst += 4;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
#endif
/* Blit with permutation: 4->3 */
if (srcbpp == 4 && dstbpp == 3 &&
srcfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
/* Find the appropriate permutation */
int p0, p1, p2, p3;
get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, NULL);
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
dst[0] = src[p0];
dst[1] = src[p1];
dst[2] = src[p2];
src += 4;
dst += 3;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
#if HAVE_FAST_WRITE_INT8
/* Blit with permutation: 3->4 */
if (srcbpp == 3 && dstbpp == 4 &&
dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
/* Find the appropriate permutation */
int alpha_channel, p0, p1, p2, p3;
get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, &alpha_channel);
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
dst[0] = src[p0];
dst[1] = src[p1];
dst[2] = src[p2];
dst[3] = src[p3];
dst[alpha_channel] = alpha;
src += 3;
dst += 4;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
#endif
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint32 Pixel;
unsigned sR;
unsigned sG;
unsigned sB;
DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
dst += dstbpp;
src += srcbpp;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
}

References SDL_BlitInfo::a, SDL_PixelFormat::Amask, ASSEMBLE_RGBA, SDL_PixelFormat::BytesPerPixel, DISEMBLE_RGB, SDL_BlitInfo::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, SDL_PixelFormat::format, get_permutation(), NULL, SDL_PIXELFORMAT_ARGB2101010, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

## BlitNtoNCopyAlpha()

static void BlitNtoNCopyAlpha | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2363 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint8 *src = info->src;
int srcskip = info->src_skip;
Uint8 *dst = info->dst;
int dstskip = info->dst_skip;
SDL_PixelFormat *srcfmt = info->src_fmt;
int srcbpp = srcfmt->BytesPerPixel;
SDL_PixelFormat *dstfmt = info->dst_fmt;
int dstbpp = dstfmt->BytesPerPixel;
int c;
#if HAVE_FAST_WRITE_INT8
/* Blit with permutation: 4->4 */
if (srcbpp == 4 && dstbpp == 4 &&
srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
/* Find the appropriate permutation */
int p0, p1, p2, p3;
get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, NULL);
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
dst[0] = src[p0];
dst[1] = src[p1];
dst[2] = src[p2];
dst[3] = src[p3];
src += 4;
dst += 4;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
#endif
while (height--) {
for (c = width; c; --c) {
Uint32 Pixel;
unsigned sR, sG, sB, sA;
DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
dst += dstbpp;
src += srcbpp;
}
src += srcskip;
dst += dstskip;
}
}

References ASSEMBLE_RGBA, SDL_PixelFormat::BytesPerPixel, DISEMBLE_RGBA, SDL_BlitInfo::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, SDL_PixelFormat::format, get_permutation(), NULL, SDL_PIXELFORMAT_ARGB2101010, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

## BlitNtoNKey()

static void BlitNtoNKey | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2521 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint8 *src = info->src;
int srcskip = info->src_skip;
Uint8 *dst = info->dst;
int dstskip = info->dst_skip;
Uint32 ckey = info->colorkey;
SDL_PixelFormat *srcfmt = info->src_fmt;
SDL_PixelFormat *dstfmt = info->dst_fmt;
int srcbpp = srcfmt->BytesPerPixel;
int dstbpp = dstfmt->BytesPerPixel;
unsigned alpha = dstfmt->Amask ? info->a : 0;
Uint32 rgbmask = ~srcfmt->Amask;
int sfmt = srcfmt->format;
int dfmt = dstfmt->format;
/* Set up some basic variables */
ckey &= rgbmask;
/* BPP 4, same rgb */
if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask) {
Uint32 *src32 = (Uint32*)src;
Uint32 *dst32 = (Uint32*)dst;
if (dstfmt->Amask) {
/* RGB->RGBA, SET_ALPHA */
Uint32 mask = info->a << dstfmt->Ashift;
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
if ((*src32 & rgbmask) != ckey) {
*dst32 = *src32 | mask;
}
++dst32;
++src32;
}, width);
/* *INDENT-ON* */
src32 = (Uint32 *) ((Uint8 *) src32 + srcskip);
dst32 = (Uint32 *) ((Uint8 *) dst32 + dstskip);
}
return;
} else {
/* RGBA->RGB, NO_ALPHA */
Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
if ((*src32 & rgbmask) != ckey) {
*dst32 = *src32 & mask;
}
++dst32;
++src32;
}, width);
/* *INDENT-ON* */
src32 = (Uint32 *) ((Uint8 *) src32 + srcskip);
dst32 = (Uint32 *) ((Uint8 *) dst32 + dstskip);
}
return;
}
}
#if HAVE_FAST_WRITE_INT8
/* Blit with permutation: 4->4 */
if (srcbpp == 4 && dstbpp == 4 &&
srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
/* Find the appropriate permutation */
int alpha_channel, p0, p1, p2, p3;
get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, &alpha_channel);
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint32 *src32 = (Uint32*)src;
if ((*src32 & rgbmask) != ckey) {
dst[0] = src[p0];
dst[1] = src[p1];
dst[2] = src[p2];
dst[3] = src[p3];
dst[alpha_channel] = alpha;
}
src += 4;
dst += 4;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
#endif
/* BPP 3, same rgb triplet */
if ((sfmt == SDL_PIXELFORMAT_RGB24 && dfmt == SDL_PIXELFORMAT_RGB24) ||
(sfmt == SDL_PIXELFORMAT_BGR24 && dfmt == SDL_PIXELFORMAT_BGR24)) {
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
Uint8 k0 = ckey & 0xFF;
Uint8 k1 = (ckey >> 8) & 0xFF;
Uint8 k2 = (ckey >> 16) & 0xFF;
#else
Uint8 k0 = (ckey >> 16) & 0xFF;
Uint8 k1 = (ckey >> 8) & 0xFF;
Uint8 k2 = ckey & 0xFF;
#endif
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint8 s0 = src[0];
Uint8 s1 = src[1];
Uint8 s2 = src[2];
if (k0 != s0 || k1 != s1 || k2 != s2) {
dst[0] = s0;
dst[1] = s1;
dst[2] = s2;
}
src += 3;
dst += 3;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
/* BPP 3, inversed rgb triplet */
if ((sfmt == SDL_PIXELFORMAT_RGB24 && dfmt == SDL_PIXELFORMAT_BGR24) ||
(sfmt == SDL_PIXELFORMAT_BGR24 && dfmt == SDL_PIXELFORMAT_RGB24)) {
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
Uint8 k0 = ckey & 0xFF;
Uint8 k1 = (ckey >> 8) & 0xFF;
Uint8 k2 = (ckey >> 16) & 0xFF;
#else
Uint8 k0 = (ckey >> 16) & 0xFF;
Uint8 k1 = (ckey >> 8) & 0xFF;
Uint8 k2 = ckey & 0xFF;
#endif
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint8 s0 = src[0];
Uint8 s1 = src[1];
Uint8 s2 = src[2];
if (k0 != s0 || k1 != s1 || k2 != s2) {
/* Inversed RGB */
dst[0] = s2;
dst[1] = s1;
dst[2] = s0;
}
src += 3;
dst += 3;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
/* Blit with permutation: 4->3 */
if (srcbpp == 4 && dstbpp == 3 &&
srcfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
/* Find the appropriate permutation */
int p0, p1, p2, p3;
get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, NULL);
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint32 *src32 = (Uint32*)src;
if ((*src32 & rgbmask) != ckey) {
dst[0] = src[p0];
dst[1] = src[p1];
dst[2] = src[p2];
}
src += 4;
dst += 3;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
#if HAVE_FAST_WRITE_INT8
/* Blit with permutation: 3->4 */
if (srcbpp == 3 && dstbpp == 4 &&
dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
Uint8 k0 = ckey & 0xFF;
Uint8 k1 = (ckey >> 8) & 0xFF;
Uint8 k2 = (ckey >> 16) & 0xFF;
#else
Uint8 k0 = (ckey >> 16) & 0xFF;
Uint8 k1 = (ckey >> 8) & 0xFF;
Uint8 k2 = ckey & 0xFF;
#endif
/* Find the appropriate permutation */
int alpha_channel, p0, p1, p2, p3;
get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, &alpha_channel);
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint8 s0 = src[0];
Uint8 s1 = src[1];
Uint8 s2 = src[2];
if (k0 != s0 || k1 != s1 || k2 != s2) {
dst[0] = src[p0];
dst[1] = src[p1];
dst[2] = src[p2];
dst[3] = src[p3];
dst[alpha_channel] = alpha;
}
src += 3;
dst += 4;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
#endif
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint32 Pixel;
unsigned sR;
unsigned sG;
unsigned sB;
RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
if ( (Pixel & rgbmask) != ckey ) {
RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
}
dst += dstbpp;
src += srcbpp;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
}

References SDL_BlitInfo::a, SDL_PixelFormat::Amask, SDL_PixelFormat::Ashift, ASSEMBLE_RGBA, SDL_PixelFormat::Bmask, SDL_PixelFormat::BytesPerPixel, SDL_BlitInfo::colorkey, SDL_BlitInfo::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, SDL_PixelFormat::format, get_permutation(), SDL_PixelFormat::Gmask, NULL, RETRIEVE_RGB_PIXEL, RGB_FROM_PIXEL, SDL_PixelFormat::Rmask, SDL_PIXELFORMAT_ARGB2101010, SDL_PIXELFORMAT_BGR24, SDL_PIXELFORMAT_RGB24, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

## BlitNtoNKeyCopyAlpha()

static void BlitNtoNKeyCopyAlpha | ( | SDL_BlitInfo * | info | ) |

static

Definition at line 2793 of file SDL_blit_N.c.

{
int width = info->dst_w;
int height = info->dst_h;
Uint8 *src = info->src;
int srcskip = info->src_skip;
Uint8 *dst = info->dst;
int dstskip = info->dst_skip;
Uint32 ckey = info->colorkey;
SDL_PixelFormat *srcfmt = info->src_fmt;
SDL_PixelFormat *dstfmt = info->dst_fmt;
Uint32 rgbmask = ~srcfmt->Amask;
Uint8 srcbpp;
Uint8 dstbpp;
Uint32 Pixel;
unsigned sR, sG, sB, sA;
/* Set up some basic variables */
srcbpp = srcfmt->BytesPerPixel;
dstbpp = dstfmt->BytesPerPixel;
ckey &= rgbmask;
/* Fastpath: same source/destination format, with Amask, bpp 32, loop is vectorized. ~10x faster */
if (srcfmt->format == dstfmt->format) {
if (srcfmt->format == SDL_PIXELFORMAT_ARGB8888 ||
srcfmt->format == SDL_PIXELFORMAT_ABGR8888 ||
srcfmt->format == SDL_PIXELFORMAT_BGRA8888 ||
srcfmt->format == SDL_PIXELFORMAT_RGBA8888) {
Uint32 *src32 = (Uint32*)src;
Uint32 *dst32 = (Uint32*)dst;
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
if ((*src32 & rgbmask) != ckey) {
*dst32 = *src32;
}
++src32;
++dst32;
},
width);
/* *INDENT-ON* */
src32 = (Uint32 *)((Uint8 *)src32 + srcskip);
dst32 = (Uint32 *)((Uint8 *)dst32 + dstskip);
}
}
return;
}
#if HAVE_FAST_WRITE_INT8
/* Blit with permutation: 4->4 */
if (srcbpp == 4 && dstbpp == 4 &&
srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
/* Find the appropriate permutation */
int p0, p1, p2, p3;
get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, NULL);
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
Uint32 *src32 = (Uint32*)src;
if ((*src32 & rgbmask) != ckey) {
dst[0] = src[p0];
dst[1] = src[p1];
dst[2] = src[p2];
dst[3] = src[p3];
}
src += 4;
dst += 4;
}, width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
return;
}
#endif
while (height--) {
/* *INDENT-OFF* */
DUFFS_LOOP(
{
DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
if ( (Pixel & rgbmask) != ckey ) {
ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
}
dst += dstbpp;
src += srcbpp;
},
width);
/* *INDENT-ON* */
src += srcskip;
dst += dstskip;
}
}

References SDL_PixelFormat::Amask, ASSEMBLE_RGBA, SDL_PixelFormat::BytesPerPixel, SDL_BlitInfo::colorkey, DISEMBLE_RGBA, SDL_BlitInfo::dst, SDL_BlitInfo::dst_fmt, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, SDL_PixelFormat::format, get_permutation(), NULL, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB2101010, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGBA8888, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

## get_permutation()

static void get_permutation | ( | SDL_PixelFormat * | srcfmt,
|  | SDL_PixelFormat * | dstfmt,
|  | int * | _p0,
|  | int * | _p1,
|  | int * | _p2,
|  | int * | _p3,
|  | int * | _alpha_channel
| ) |  |

static

Definition at line 2163 of file SDL_blit_N.c.

{
int alpha_channel = 0, p0, p1, p2, p3;
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
int Pixel = 0x04030201; /* identity permutation */
#else
int Pixel = 0x01020304; /* identity permutation */
int srcbpp = srcfmt->BytesPerPixel;
int dstbpp = dstfmt->BytesPerPixel;
#endif
if (srcfmt->Amask) {
RGBA_FROM_PIXEL(Pixel, srcfmt, p0, p1, p2, p3);
} else {
RGB_FROM_PIXEL(Pixel, srcfmt, p0, p1, p2);
p3 = 0;
}
if (dstfmt->Amask) {
if (srcfmt->Amask) {
PIXEL_FROM_RGBA(Pixel, dstfmt, p0, p1, p2, p3);
} else {
PIXEL_FROM_RGBA(Pixel, dstfmt, p0, p1, p2, 0);
}
} else {
PIXEL_FROM_RGB(Pixel, dstfmt, p0, p1, p2);
}
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
p0 = Pixel & 0xFF;
p1 = (Pixel >> 8) & 0xFF;
p2 = (Pixel >> 16) & 0xFF;
p3 = (Pixel >> 24) & 0xFF;
#else
p3 = Pixel & 0xFF;
p2 = (Pixel >> 8) & 0xFF;
p1 = (Pixel >> 16) & 0xFF;
p0 = (Pixel >> 24) & 0xFF;
#endif
if (p0 == 0) {
p0 = 1;
alpha_channel = 0;
} else if (p1 == 0) {
p1 = 1;
alpha_channel = 1;
} else if (p2 == 0) {
p2 = 1;
alpha_channel = 2;
} else if (p3 == 0) {
p3 = 1;
alpha_channel = 3;
}
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#else
if (srcbpp == 3 && dstbpp == 4) {
if (p0 != 1) p0--;
if (p1 != 1) p1--;
if (p2 != 1) p2--;
if (p3 != 1) p3--;
} else if (srcbpp == 4 && dstbpp == 3) {
p0 = p1;
p1 = p2;
p2 = p3;
}
#endif
*_p0 = p0 - 1;
*_p1 = p1 - 1;
*_p2 = p2 - 1;
*_p3 = p3 - 1;
if (_alpha_channel) {
*_alpha_channel = alpha_channel;
}
return;
}

References SDL_PixelFormat::Amask, SDL_PixelFormat::BytesPerPixel, PIXEL_FROM_RGB, PIXEL_FROM_RGBA, RGB_FROM_PIXEL, and RGBA_FROM_PIXEL.

Referenced by BlitNtoN(), BlitNtoNCopyAlpha(), BlitNtoNKey(), and BlitNtoNKeyCopyAlpha().

## SDL_CalculateBlitN()

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

Definition at line 3266 of file SDL_blit_N.c.

{
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 */
Uint32 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;
}

References 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_PixelFormat::format, GetBlitFeatures, SDL_PixelFormat::Gmask, MASKOK, NO_ALPHA, normal_blit, NULL, SDL_PixelFormat::Rmask, SDL_COPY_COLORKEY, SDL_COPY_RLE_MASK, SDL_HasAltiVec, SDL_PIXELFORMAT_ARGB2101010, and SET_ALPHA.

Referenced by SDL_CalculateBlit().

## Variable Documentation

## normal_blit

const struct blit_table* const normal_blit[]

static

Initial value:
= {
normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
}

Definition at line 3258 of file SDL_blit_N.c.

Referenced by SDL_CalculateBlitN().

## normal_blit_1

const struct blit_table normal_blit_1[]

static

Initial value:
= {
{0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
}

Definition at line 3152 of file SDL_blit_N.c.

## normal_blit_2

const struct blit_table normal_blit_2[]

static

Initial value:
= {
{0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF,
0, Blit_RGB565_ARGB8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
{0x0000F800, 0x000007E0, 0x0000001F, 4, 0x000000FF, 0x0000FF00, 0x00FF0000,
0, Blit_RGB565_ABGR8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
{0x0000F800, 0x000007E0, 0x0000001F, 4, 0xFF000000, 0x00FF0000, 0x0000FF00,
0, Blit_RGB565_RGBA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
{0x0000F800, 0x000007E0, 0x0000001F, 4, 0x0000FF00, 0x00FF0000, 0xFF000000,
0, Blit_RGB565_BGRA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
{0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
}

Definition at line 3157 of file SDL_blit_N.c.

## normal_blit_3

const struct blit_table normal_blit_3[]

static

Definition at line 3178 of file SDL_blit_N.c.

## normal_blit_4

const struct blit_table normal_blit_4[]

static

Definition at line 3214 of file SDL_blit_N.c.

## RGB565_ABGR8888_LUT

const Uint32 RGB565_ABGR8888_LUT[512]

static

Definition at line 1577 of file SDL_blit_N.c.

Referenced by Blit_RGB565_ABGR8888().

## RGB565_ARGB8888_LUT

const Uint32 RGB565_ARGB8888_LUT[512]

static

Definition at line 1439 of file SDL_blit_N.c.

Referenced by Blit_RGB565_ARGB8888().

## RGB565_BGRA8888_LUT

const Uint32 RGB565_BGRA8888_LUT[512]

static

Definition at line 1853 of file SDL_blit_N.c.

Referenced by Blit_RGB565_BGRA8888().

## RGB565_RGBA8888_LUT

const Uint32 RGB565_RGBA8888_LUT[512]

static

Definition at line 1715 of file SDL_blit_N.c.

Referenced by Blit_RGB565_RGBA8888().

Blit_RGB101010_index8
static void Blit_RGB101010_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1016
SDL_BlitInfo::src
Uint8 * src
Definition: SDL_blit.h:57
SDL_BlitInfo::src_skip
int src_skip
Definition: SDL_blit.h:60
SDL_PixelFormat::Ashift
Uint8 Ashift
Definition: SDL_pixels.h:333
c
const GLubyte * c
Definition: SDL_opengl_glext.h:11093
COPY_ALPHA
#define COPY_ALPHA
Definition: SDL_blit_N.c:3142
ASSEMBLE_RGBA
#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)
Definition: SDL_blit.h:402
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
Blit_RGB565_RGBA8888
static void Blit_RGB565_RGBA8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1847
RGB888_RGB565
#define RGB888_RGB565(dst, src)
Definition: SDL_blit_N.c:1246
SDL_PixelFormat::BitsPerPixel
Uint8 BitsPerPixel
Definition: SDL_pixels.h:319
ARGB2101010_FROM_RGBA
#define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a)
Definition: SDL_blit.h:253
SDL_PixelFormat::BytesPerPixel
Uint8 BytesPerPixel
Definition: SDL_pixels.h:320
i1
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 i1
Definition: SDL_glfuncs.h:141
SDL_HasAltiVec
#define SDL_HasAltiVec
Definition: SDL_dynapi_overrides.h:104
RGB565_BGRA8888_LUT
static const Uint32 RGB565_BGRA8888_LUT[512]
Definition: SDL_blit_N.c:1853
mask
GLenum GLint GLuint mask
Definition: SDL_opengl_glext.h:657
RGB101010_RGB332
#define RGB101010_RGB332(dst, src)
Definition: SDL_blit_N.c:1010
RGBA_FROM_ARGB2101010
#define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a)
Definition: SDL_blit.h:346
normal_blit_4
static const struct blit_table normal_blit_4[]
Definition: SDL_blit_N.c:3214
PIXEL_FROM_RGBA
#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)
Definition: SDL_blit.h:395
NULL
#define NULL
Definition: begin_code.h:167
surface
EGLSurface surface
Definition: eglext.h:248
SDL_PixelFormat::format
Uint32 format
Definition: SDL_pixels.h:317
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
normal_blit
static const struct blit_table *const normal_blit[]
Definition: SDL_blit_N.c:3258
RETRIEVE_RGB_PIXEL
#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel)
Definition: SDL_blit.h:146
SDL_BlitInfo::dst_w
int dst_w
Definition: SDL_blit.h:62
MASKOK
#define MASKOK(x, y)
Definition: SDL_blit_N.c:3263
Blit_RGB888_index8
static void Blit_RGB888_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:906
BlitNtoNKey
static void BlitNtoNKey(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2521
SDL_BlitInfo::dst_h
int dst_h
Definition: SDL_blit.h:62
SDL_COPY_COLORKEY
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:39
SDL_PixelFormat::Rmask
Uint32 Rmask
Definition: SDL_pixels.h:322
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:291
Blit2101010toN
static void Blit2101010toN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2897
Blit4to4CopyAlpha
static void Blit4to4CopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2136
SDL_COPY_RLE_MASK
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:44
DISEMBLE_RGBA
#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)
Definition: SDL_blit.h:353
i2
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 i2
Definition: SDL_glfuncs.h:141
s1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
Definition: SDL_opengl_glext.h:8583
Blit_RGB565_ARGB8888
static void Blit_RGB565_ARGB8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1571
alpha
GLfloat GLfloat GLfloat alpha
Definition: SDL_opengl_glext.h:412
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_BlitInfo::dst
Uint8 * dst
Definition: SDL_blit.h:61
DUFFS_LOOP
#define DUFFS_LOOP(pixel_copy_increment, width)
Definition: SDL_blit.h:500
get_permutation
static void get_permutation(SDL_PixelFormat *srcfmt, SDL_PixelFormat *dstfmt, int *_p0, int *_p1, int *_p2, int *_p3, int *_alpha_channel)
Definition: SDL_blit_N.c:2163
s0
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s0
Definition: SDL_opengl_glext.h:8583
BlitNtoN
static void BlitNtoN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2244
NO_ALPHA
#define NO_ALPHA
Definition: SDL_blit_N.c:3140
SDL_BlitInfo::src_fmt
SDL_PixelFormat * src_fmt
Definition: SDL_blit.h:65
height
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
SDL_PIXELFORMAT_ARGB2101010
@ SDL_PIXELFORMAT_ARGB2101010
Definition: SDL_pixels.h:260
SDL_BlitInfo::dst_skip
int dst_skip
Definition: SDL_blit.h:64
SDL_BlitInfo::table
Uint8 * table
Definition: SDL_blit.h:67
Blit4to4MaskAlpha
static void Blit4to4MaskAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2086
SET_ALPHA
#define SET_ALPHA
Definition: SDL_blit_N.c:3141
Uint16
uint16_t Uint16
Definition: SDL_stdinc.h:191
RGB565_32
#define RGB565_32(dst, src, map)
Definition: SDL_blit_N.c:1373
blit_table::blitfunc
SDL_BlitFunc blitfunc
Definition: SDL_blit_N.c:3149
SDL_PixelFormat::Amask
Uint32 Amask
Definition: SDL_pixels.h:325
normal_blit_2
static const struct blit_table normal_blit_2[]
Definition: SDL_blit_N.c:3157
SDL_PIXELFORMAT_ARGB8888
@ SDL_PIXELFORMAT_ARGB8888
Definition: SDL_pixels.h:248
SDL_PixelFormat
Definition: SDL_pixels.h:315
SDL_BlitInfo::a
Uint8 a
Definition: SDL_blit.h:70
SDL_PixelFormat::Gmask
Uint32 Gmask
Definition: SDL_pixels.h:323
BlitNto1Key
static void BlitNto1Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2421
SDL_BlitInfo::dst_fmt
SDL_PixelFormat * dst_fmt
Definition: SDL_blit.h:66
GetBlitFeatures
#define GetBlitFeatures()
Definition: SDL_blit_N.c:887
normal_blit_1
static const struct blit_table normal_blit_1[]
Definition: SDL_blit_N.c:3152
DISEMBLE_RGB
#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b)
Definition: SDL_blit.h:177
Blit_RGB565_ABGR8888
static void Blit_RGB565_ABGR8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1709
RGB888_RGB555
#define RGB888_RGB555(dst, src)
Definition: SDL_blit_N.c:1120
SDL_PixelFormat::Bmask
Uint32 Bmask
Definition: SDL_pixels.h:324
normal_blit_3
static const struct blit_table normal_blit_3[]
Definition: SDL_blit_N.c:3178
BlitNtoNCopyAlpha
static void BlitNtoNCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2363
src
GLenum src
Definition: SDL_opengl_glext.h:1737
BlitNto2101010
static void BlitNto2101010(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2929
BlitNtoNKeyCopyAlpha
static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2793
SDL_PIXELFORMAT_RGBA8888
@ SDL_PIXELFORMAT_RGBA8888
Definition: SDL_pixels.h:251
PIXEL_FROM_RGB
#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)
Definition: SDL_blit.h:218
j1
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 j1
Definition: SDL_glfuncs.h:141
blit_table::dstbpp
int dstbpp
Definition: SDL_blit_N.c:3146
SDL_PixelFormat::Aloss
Uint8 Aloss
Definition: SDL_pixels.h:329
Blit_RGB565_32
static void Blit_RGB565_32(SDL_BlitInfo *info, const Uint32 *map)
Definition: SDL_blit_N.c:1375
SDL_PIXELFORMAT_RGB24
@ SDL_PIXELFORMAT_RGB24
Definition: SDL_pixels.h:230
SDL_BlitInfo::colorkey
Uint32 colorkey
Definition: SDL_blit.h:69
Blit_RGB565_BGRA8888
static void Blit_RGB565_BGRA8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1985
SDL_PIXELFORMAT_BGRA8888
@ SDL_PIXELFORMAT_BGRA8888
Definition: SDL_pixels.h:257
SDL_PIXELFORMAT_BGR24
@ SDL_PIXELFORMAT_BGR24
Definition: SDL_pixels.h:233
RGB565_RGBA8888_LUT
static const Uint32 RGB565_RGBA8888_LUT[512]
Definition: SDL_blit_N.c:1715
RGB_FROM_PIXEL
#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b)
Definition: SDL_blit.h:122
RGB565_ABGR8888_LUT
static const Uint32 RGB565_ABGR8888_LUT[512]
Definition: SDL_blit_N.c:1577
RGB565_ARGB8888_LUT
static const Uint32 RGB565_ARGB8888_LUT[512]
Definition: SDL_blit_N.c:1439
RGB888_RGB332
#define RGB888_RGB332(dst, src)
Definition: SDL_blit_N.c:900
blit_table
Definition: SDL_blit_N.c:3143
Blit2to2Key
static void Blit2to2Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2487
SDL_PIXELFORMAT_ABGR8888
@ SDL_PIXELFORMAT_ABGR8888
Definition: SDL_pixels.h:254
blit_table::blit_features
Uint32 blit_features
Definition: SDL_blit_N.c:3148
table
GLenum GLsizei GLenum GLenum const void * table
Definition: SDL_opengl_glext.h:3118
RGBA_FROM_PIXEL
#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a)
Definition: SDL_blit.h:304
BlitNto1
static void BlitNto1(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1991
SDL_BlitFunc
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:73
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179