zenilib: zenilib/jni/external/sdl/src/video/SDL_blit_N.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables
SDL_blit_N.c File Reference
`#include "SDL_config.h"`
`#include "SDL_video.h"`
`#include "SDL_endian.h"`
`#include "SDL_cpuinfo.h"`
`#include "SDL_blit.h"`
`#include "SDL_assert.h"`

Go to the source code of this file.

## Macros

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

## Functions

static void | Blit2101010toN (SDL_BlitInfo *info)
static void | Blit2to2Key (SDL_BlitInfo *info)
static void | Blit4to4MaskAlpha (SDL_BlitInfo *info)
static void | Blit_RGB101010_index8 (SDL_BlitInfo *info)
static void | Blit_RGB565_32 (SDL_BlitInfo *info, const Uint32 *map)
static void | Blit_RGB565_ABGR8888 (SDL_BlitInfo *info)
static void | Blit_RGB565_ARGB8888 (SDL_BlitInfo *info)
static void | Blit_RGB565_BGRA8888 (SDL_BlitInfo *info)
static void | Blit_RGB565_RGBA8888 (SDL_BlitInfo *info)
static void | Blit_RGB888_index8 (SDL_BlitInfo *info)
static void | Blit_RGB888_RGB555 (SDL_BlitInfo *info)
static void | Blit_RGB888_RGB565 (SDL_BlitInfo *info)
static void | BlitNto1 (SDL_BlitInfo *info)
static void | BlitNto1Key (SDL_BlitInfo *info)
static void | BlitNto2101010 (SDL_BlitInfo *info)
static void | BlitNtoN (SDL_BlitInfo *info)
static void | BlitNtoNCopyAlpha (SDL_BlitInfo *info)
static void | BlitNtoNKey (SDL_BlitInfo *info)
static void | BlitNtoNKeyCopyAlpha (SDL_BlitInfo *info)
SDL_BlitFunc | SDL_CalculateBlitN (SDL_Surface *surface)

## Variables

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

## Macro Definition Documentation

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

Definition at line 874 of file SDL_blit_N.c.

Referenced by SDL_CalculateBlitN().

#define HI 1

Definition at line 879 of file SDL_blit_N.c.

#define LO 0

Definition at line 880 of file SDL_blit_N.c.

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

Definition at line 2497 of file SDL_blit_N.c.

Referenced by SDL_CalculateBlitN().

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

Value:
{ \
dst = (Uint8)((((src)&0x38000000)>>22)| \
(((src)&0x000E0000)>>15)| \
(((src)&0x00000300)>>8)); \
}
dst
GLenum GLenum dst
Definition: glew.h:2396
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:129
src
GLenum src
Definition: glew.h:2396

Definition at line 997 of file SDL_blit_N.c.

Referenced by Blit_RGB101010_index8().

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

Definition at line 1356 of file SDL_blit_N.c.

Referenced by Blit_RGB565_32().

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

Value:
{ \
dst = (Uint8)((((src)&0x00E00000)>>16)| \
(((src)&0x0000E000)>>11)| \
(((src)&0x000000C0)>>6)); \
}
dst
GLenum GLenum dst
Definition: glew.h:2396
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:129
src
GLenum src
Definition: glew.h:2396

Definition at line 887 of file SDL_blit_N.c.

Referenced by Blit_RGB888_index8().

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

Value:
{ \
*(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>9)| \
(((*src)&0x0000F800)>>6)| \
(((*src)&0x000000F8)>>3)); \
}
dst
GLenum GLenum dst
Definition: glew.h:2396
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:137
src
GLenum src
Definition: glew.h:2396

Definition at line 1107 of file SDL_blit_N.c.

Referenced by Blit_RGB888_RGB555().

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

Value:
{ \
*(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>9)| \
(((src[HI])&0x0000F800)>>6)| \
(((src[HI])&0x000000F8)>>3))<<16)| \
(((src[LO])&0x00F80000)>>9)| \
(((src[LO])&0x0000F800)>>6)| \
(((src[LO])&0x000000F8)>>3); \
}
HI
#define HI
Definition: SDL_blit_N.c:879
LO
#define LO
Definition: SDL_blit_N.c:880
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:145
dst
GLenum GLenum dst
Definition: glew.h:2396
src
GLenum src
Definition: glew.h:2396

Definition at line 1112 of file SDL_blit_N.c.

Referenced by Blit_RGB888_RGB555().

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

Value:
{ \
*(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \
(((*src)&0x0000FC00)>>5)| \
(((*src)&0x000000F8)>>3)); \
}
dst
GLenum GLenum dst
Definition: glew.h:2396
Uint16
uint16_t Uint16
An unsigned 16-bit integer type.
Definition: SDL_stdinc.h:137
src
GLenum src
Definition: glew.h:2396

Definition at line 1231 of file SDL_blit_N.c.

Referenced by Blit_RGB888_RGB565().

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

Value:
{ \
*(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>8)| \
(((src[HI])&0x0000FC00)>>5)| \
(((src[HI])&0x000000F8)>>3))<<16)| \
(((src[LO])&0x00F80000)>>8)| \
(((src[LO])&0x0000FC00)>>5)| \
(((src[LO])&0x000000F8)>>3); \
}
HI
#define HI
Definition: SDL_blit_N.c:879
LO
#define LO
Definition: SDL_blit_N.c:880
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:145
dst
GLenum GLenum dst
Definition: glew.h:2396
src
GLenum src
Definition: glew.h:2396

Definition at line 1236 of file SDL_blit_N.c.

Referenced by Blit_RGB888_RGB565().

## Function Documentation

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

static

Definition at line 2368 of file SDL_blit_N.c.

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

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

static

Definition at line 2248 of file SDL_blit_N.c.

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

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

static

Definition at line 2069 of file SDL_blit_N.c.

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, SDL_BlitInfo::src_skip, and while().

Referenced by SDL_CalculateBlitN().

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

static

Definition at line 1003 of file SDL_blit_N.c.

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

Referenced by SDL_CalculateBlitN().

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

static

Definition at line 1358 of file SDL_blit_N.c.

References SDL_BlitInfo::dst, SDL_BlitInfo::dst_h, SDL_BlitInfo::dst_skip, SDL_BlitInfo::dst_w, DUFFS_LOOP, 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().

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

static

Definition at line 1692 of file SDL_blit_N.c.

References Blit_RGB565_32().

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

static

Definition at line 1554 of file SDL_blit_N.c.

References Blit_RGB565_32().

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

static

Definition at line 1968 of file SDL_blit_N.c.

References Blit_RGB565_32().

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

static

Definition at line 1830 of file SDL_blit_N.c.

References Blit_RGB565_32().

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

static

Definition at line 893 of file SDL_blit_N.c.

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

Referenced by SDL_CalculateBlitN().

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

static

Definition at line 1121 of file SDL_blit_N.c.

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

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

static

Definition at line 1245 of file SDL_blit_N.c.

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

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

static

Definition at line 1974 of file SDL_blit_N.c.

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

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

static

Definition at line 2182 of file SDL_blit_N.c.

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

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

static

Definition at line 2400 of file SDL_blit_N.c.

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

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

static

Definition at line 2118 of file SDL_blit_N.c.

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_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

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

static

Definition at line 2153 of file SDL_blit_N.c.

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, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

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

static

Definition at line 2282 of file SDL_blit_N.c.

References SDL_BlitInfo::a, SDL_PixelFormat::Amask, ASSEMBLE_RGBA, 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, RETRIEVE_RGB_PIXEL, RGB_FROM_PIXEL, SDL_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

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

static

Definition at line 2325 of file SDL_blit_N.c.

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_BlitInfo::src, SDL_BlitInfo::src_fmt, and SDL_BlitInfo::src_skip.

Referenced by SDL_CalculateBlitN().

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

Definition at line 2500 of file SDL_blit_N.c.

References SDL_PixelFormat::Amask, SDL_PixelFormat::BitsPerPixel, Blit2101010toN(), Blit2to2Key(), Blit4to4MaskAlpha(), Blit_RGB101010_index8(), Blit_RGB888_index8(), BlitNto1(), BlitNto1Key(), BlitNto2101010(), BlitNtoN(), BlitNtoNCopyAlpha(), BlitNtoNKey(), BlitNtoNKeyCopyAlpha(), SDL_PixelFormat::Bmask, SDL_PixelFormat::BytesPerPixel, SDL_BlitMap::dst, SDL_BlitInfo::flags, SDL_Surface::format, SDL_PixelFormat::format, GetBlitFeatures, SDL_PixelFormat::Gmask, SDL_BlitMap::identity, SDL_BlitMap::info, SDL_Surface::map, MASKOK, NULL, SDL_PixelFormat::Rmask, SDL_COPY_COLORKEY, SDL_COPY_RLE_MASK, SDL_HasAltiVec(), and SDL_PIXELFORMAT_ARGB2101010.

Referenced by SDL_CalculateBlit().

## Variable Documentation

struct blit_table* const normal_blit[]

static

Initial value:
= {
normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
}
normal_blit_2
static struct blit_table normal_blit_2[]
Definition: SDL_blit_N.c:2446
normal_blit_3
static struct blit_table normal_blit_3[]
Definition: SDL_blit_N.c:2467
normal_blit_4
static struct blit_table normal_blit_4[]
Definition: SDL_blit_N.c:2472
normal_blit_1
static struct blit_table normal_blit_1[]
Definition: SDL_blit_N.c:2441

Definition at line 2492 of file SDL_blit_N.c.

struct blit_table normal_blit_1[]

static

Initial value:
= {
{0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
}
BlitNtoN
static void BlitNtoN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2118

Definition at line 2441 of file SDL_blit_N.c.

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}
}
Blit_RGB565_ARGB8888
static void Blit_RGB565_ARGB8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1554
Blit_RGB565_RGBA8888
static void Blit_RGB565_RGBA8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1830
Blit_RGB565_BGRA8888
static void Blit_RGB565_BGRA8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1968
BlitNtoN
static void BlitNtoN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2118
Blit_RGB565_ABGR8888
static void Blit_RGB565_ABGR8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1692

Definition at line 2446 of file SDL_blit_N.c.

struct blit_table normal_blit_3[]

static

Initial value:
= {
{0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
}
BlitNtoN
static void BlitNtoN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2118

Definition at line 2467 of file SDL_blit_N.c.

struct blit_table normal_blit_4[]

static

Initial value:
= {
{0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0, 0x0000001F,
0, Blit_RGB888_RGB565, NO_ALPHA},
{0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0, 0x0000001F,
0, Blit_RGB888_RGB555, NO_ALPHA},
{0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
}
BlitNtoN
static void BlitNtoN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2118
Blit_RGB888_RGB555
static void Blit_RGB888_RGB555(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1121
Blit_RGB888_RGB565
static void Blit_RGB888_RGB565(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1245

Definition at line 2472 of file SDL_blit_N.c.

const Uint32 RGB565_ABGR8888_LUT[512]

static

Definition at line 1560 of file SDL_blit_N.c.

const Uint32 RGB565_ARGB8888_LUT[512]

static

Definition at line 1422 of file SDL_blit_N.c.

const Uint32 RGB565_BGRA8888_LUT[512]

static

Definition at line 1836 of file SDL_blit_N.c.

const Uint32 RGB565_RGBA8888_LUT[512]

static

Definition at line 1698 of file SDL_blit_N.c.