SDL  2.0
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 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()   ((SDL_HasMMX() ? BLIT_FEATURE_HAS_MMX : 0) | (SDL_HasARMSIMD() ? BLIT_FEATURE_HAS_ARM_SIMD : 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))
 

Enumerations

enum  blit_features {
  BLIT_FEATURE_NONE = 0 ,
  BLIT_FEATURE_HAS_MMX = 1 ,
  BLIT_FEATURE_HAS_ALTIVEC = 2 ,
  BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH = 4 ,
  BLIT_FEATURE_HAS_ARM_SIMD = 8
}
 

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 3225 of file SDL_blit_N.c.

◆ GetBlitFeatures

#define GetBlitFeatures ( )    ((SDL_HasMMX() ? BLIT_FEATURE_HAS_MMX : 0) | (SDL_HasARMSIMD() ? BLIT_FEATURE_HAS_ARM_SIMD : 0))

Definition at line 937 of file SDL_blit_N.c.

◆ HAVE_FAST_WRITE_INT8

#define HAVE_FAST_WRITE_INT8   1

Definition at line 32 of file SDL_blit_N.c.

◆ HI

#define HI   1

Definition at line 974 of file SDL_blit_N.c.

◆ LO

#define LO   0

Definition at line 975 of file SDL_blit_N.c.

◆ MASKOK

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

Definition at line 3356 of file SDL_blit_N.c.

◆ NO_ALPHA

#define NO_ALPHA   1

Definition at line 3223 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)); \
}
GLenum src
uint8_t Uint8
Definition: SDL_stdinc.h:185

Definition at line 1092 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 1457 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 982 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)); \
}
GLenum GLenum dst
uint16_t Uint16
Definition: SDL_stdinc.h:197

Definition at line 1202 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 1328 of file SDL_blit_N.c.

◆ SET_ALPHA

#define SET_ALPHA   2

Definition at line 3224 of file SDL_blit_N.c.

Enumeration Type Documentation

◆ blit_features

Enumerator
BLIT_FEATURE_NONE 
BLIT_FEATURE_HAS_MMX 
BLIT_FEATURE_HAS_ALTIVEC 
BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH 
BLIT_FEATURE_HAS_ARM_SIMD 

Definition at line 42 of file SDL_blit_N.c.

42  {
48 };
@ BLIT_FEATURE_NONE
Definition: SDL_blit_N.c:43
@ BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH
Definition: SDL_blit_N.c:46
@ BLIT_FEATURE_HAS_ARM_SIMD
Definition: SDL_blit_N.c:47
@ BLIT_FEATURE_HAS_ALTIVEC
Definition: SDL_blit_N.c:45
@ BLIT_FEATURE_HAS_MMX
Definition: SDL_blit_N.c:44

Function Documentation

◆ Blit2101010toN()

static void Blit2101010toN ( SDL_BlitInfo info)
static

Definition at line 2982 of file SDL_blit_N.c.

2983 {
2984  int width = info->dst_w;
2985  int height = info->dst_h;
2986  Uint8 *src = info->src;
2987  int srcskip = info->src_skip;
2988  Uint8 *dst = info->dst;
2989  int dstskip = info->dst_skip;
2990  SDL_PixelFormat *dstfmt = info->dst_fmt;
2991  int dstbpp = dstfmt->BytesPerPixel;
2992  Uint32 Pixel;
2993  unsigned sR, sG, sB, sA;
2994 
2995  while (height--) {
2996  /* *INDENT-OFF* */
2997  DUFFS_LOOP(
2998  {
2999  Pixel = *(Uint32 *)src;
3000  RGBA_FROM_ARGB2101010(Pixel, sR, sG, sB, sA);
3001  ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
3002  dst += dstbpp;
3003  src += 4;
3004  },
3005  width);
3006  /* *INDENT-ON* */
3007  src += srcskip;
3008  dst += dstskip;
3009  }
3010 }
#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a)
Definition: SDL_blit.h:403
#define DUFFS_LOOP(pixel_copy_increment, width)
Definition: SDL_blit.h:501
#define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a)
Definition: SDL_blit.h:347
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
uint32_t Uint32
Definition: SDL_stdinc.h:209
int dst_skip
Definition: SDL_blit.h:65
SDL_PixelFormat * dst_fmt
Definition: SDL_blit.h:67
int src_skip
Definition: SDL_blit.h:61
Uint8 * src
Definition: SDL_blit.h:58
Uint8 * dst
Definition: SDL_blit.h:62
Uint8 BytesPerPixel
Definition: SDL_pixels.h:329

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 2572 of file SDL_blit_N.c.

2573 {
2574  int width = info->dst_w;
2575  int height = info->dst_h;
2576  Uint16 *srcp = (Uint16 *) info->src;
2577  int srcskip = info->src_skip;
2578  Uint16 *dstp = (Uint16 *) info->dst;
2579  int dstskip = info->dst_skip;
2580  Uint32 ckey = info->colorkey;
2581  Uint32 rgbmask = ~info->src_fmt->Amask;
2582 
2583  /* Set up some basic variables */
2584  srcskip /= 2;
2585  dstskip /= 2;
2586  ckey &= rgbmask;
2587 
2588  while (height--) {
2589  /* *INDENT-OFF* */
2590  DUFFS_LOOP(
2591  {
2592  if ( (*srcp & rgbmask) != ckey ) {
2593  *dstp = *srcp;
2594  }
2595  dstp++;
2596  srcp++;
2597  },
2598  width);
2599  /* *INDENT-ON* */
2600  srcp += srcskip;
2601  dstp += dstskip;
2602  }
2603 }
SDL_PixelFormat * src_fmt
Definition: SDL_blit.h:66
Uint32 colorkey
Definition: SDL_blit.h:70

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 2222 of file SDL_blit_N.c.

2223 {
2224  int width = info->dst_w;
2225  int height = info->dst_h;
2226  Uint32 *src = (Uint32 *) info->src;
2227  int srcskip = info->src_skip;
2228  Uint32 *dst = (Uint32 *) info->dst;
2229  int dstskip = info->dst_skip;
2230 
2231  /* RGBA->RGBA, COPY_ALPHA */
2232  while (height--) {
2233  /* *INDENT-OFF* */
2234  DUFFS_LOOP(
2235  {
2236  *dst = *src;
2237  ++dst;
2238  ++src;
2239  },
2240  width);
2241  /* *INDENT-ON* */
2242  src = (Uint32 *) ((Uint8 *) src + srcskip);
2243  dst = (Uint32 *) ((Uint8 *) dst + dstskip);
2244  }
2245 }

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 2172 of file SDL_blit_N.c.

2173 {
2174  int width = info->dst_w;
2175  int height = info->dst_h;
2176  Uint32 *src = (Uint32 *) info->src;
2177  int srcskip = info->src_skip;
2178  Uint32 *dst = (Uint32 *) info->dst;
2179  int dstskip = info->dst_skip;
2180  SDL_PixelFormat *srcfmt = info->src_fmt;
2181  SDL_PixelFormat *dstfmt = info->dst_fmt;
2182 
2183  if (dstfmt->Amask) {
2184  /* RGB->RGBA, SET_ALPHA */
2185  Uint32 mask = ((Uint32)info->a >> dstfmt->Aloss) << dstfmt->Ashift;
2186 
2187  while (height--) {
2188  /* *INDENT-OFF* */
2189  DUFFS_LOOP(
2190  {
2191  *dst = *src | mask;
2192  ++dst;
2193  ++src;
2194  },
2195  width);
2196  /* *INDENT-ON* */
2197  src = (Uint32 *) ((Uint8 *) src + srcskip);
2198  dst = (Uint32 *) ((Uint8 *) dst + dstskip);
2199  }
2200  } else {
2201  /* RGBA->RGB, NO_ALPHA */
2202  Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
2203 
2204  while (height--) {
2205  /* *INDENT-OFF* */
2206  DUFFS_LOOP(
2207  {
2208  *dst = *src & mask;
2209  ++dst;
2210  ++src;
2211  },
2212  width);
2213  /* *INDENT-ON* */
2214  src = (Uint32 *) ((Uint8 *) src + srcskip);
2215  dst = (Uint32 *) ((Uint8 *) dst + dstskip);
2216  }
2217  }
2218 }
GLenum GLint GLuint mask
Uint8 a
Definition: SDL_blit.h:71

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 3120 of file SDL_blit_N.c.

3121 {
3122  int width = info->dst_w;
3123  int height = info->dst_h;
3124  Uint8 *src = info->src;
3125  int srcskip = info->src_skip;
3126  Uint8 *dst = info->dst;
3127  int dstskip = info->dst_skip;
3128  SDL_PixelFormat *srcfmt = info->src_fmt;
3129  int srcbpp = srcfmt->BytesPerPixel;
3130  SDL_PixelFormat *dstfmt = info->dst_fmt;
3131  int dstbpp = dstfmt->BytesPerPixel;
3132 
3133  if (dstfmt->Amask) {
3134  if (srcfmt->Amask) {
3135  /* COPY_ALPHA */
3136  /* Only to switch ABGR8888 <-> ARGB8888 */
3137  while (height--) {
3138 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
3139  int i0 = 0, i1 = 1, i2 = 2, i3 = 3;
3140 #else
3141  int i0 = 3, i1 = 2, i2 = 1, i3 = 0;
3142 #endif
3143  /* *INDENT-OFF* */
3144  DUFFS_LOOP(
3145  {
3146  Uint32 *dst32 = (Uint32*)dst;
3147  Uint8 s0 = src[i0];
3148  Uint8 s1 = src[i1];
3149  Uint8 s2 = src[i2];
3150  Uint32 alphashift = ((Uint32)src[i3]) << dstfmt->Ashift;
3151  /* inversed, compared to Blit_3or4_to_3or4__same_rgb */
3152  *dst32 = (s0 << 16) | (s1 << 8) | (s2) | alphashift;
3153  dst += 4;
3154  src += 4;
3155  }, width);
3156  /* *INDENT-ON* */
3157  src += srcskip;
3158  dst += dstskip;
3159  }
3160  } else {
3161  /* SET_ALPHA */
3162  Uint32 mask = ((Uint32)info->a) << dstfmt->Ashift;
3163 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
3164  int i0 = 0, i1 = 1, i2 = 2;
3165 #else
3166  int i0 = srcbpp - 1 - 0;
3167  int i1 = srcbpp - 1 - 1;
3168  int i2 = srcbpp - 1 - 2;
3169 #endif
3170  while (height--) {
3171  /* *INDENT-OFF* */
3172  DUFFS_LOOP(
3173  {
3174  Uint32 *dst32 = (Uint32*)dst;
3175  Uint8 s0 = src[i0];
3176  Uint8 s1 = src[i1];
3177  Uint8 s2 = src[i2];
3178  /* inversed, compared to Blit_3or4_to_3or4__same_rgb */
3179  *dst32 = (s0 << 16) | (s1 << 8) | (s2) | mask;
3180  dst += 4;
3181  src += srcbpp;
3182  }, width);
3183  /* *INDENT-ON* */
3184  src += srcskip;
3185  dst += dstskip;
3186  }
3187  }
3188  } else {
3189  /* NO_ALPHA */
3190 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
3191  int i0 = 0, i1 = 1, i2 = 2;
3192  int j0 = 2, j1 = 1, j2 = 0;
3193 #else
3194  int i0 = srcbpp - 1 - 0;
3195  int i1 = srcbpp - 1 - 1;
3196  int i2 = srcbpp - 1 - 2;
3197  int j0 = dstbpp - 1 - 2;
3198  int j1 = dstbpp - 1 - 1;
3199  int j2 = dstbpp - 1 - 0;
3200 #endif
3201  while (height--) {
3202  /* *INDENT-OFF* */
3203  DUFFS_LOOP(
3204  {
3205  Uint8 s0 = src[i0];
3206  Uint8 s1 = src[i1];
3207  Uint8 s2 = src[i2];
3208  /* inversed, compared to Blit_3or4_to_3or4__same_rgb */
3209  dst[j0] = s0;
3210  dst[j1] = s1;
3211  dst[j2] = s2;
3212  dst += dstbpp;
3213  src += srcbpp;
3214  }, width);
3215  /* *INDENT-ON* */
3216  src += srcskip;
3217  dst += dstskip;
3218  }
3219  }
3220 }
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
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
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
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s0

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 3046 of file SDL_blit_N.c.

3047 {
3048  int width = info->dst_w;
3049  int height = info->dst_h;
3050  Uint8 *src = info->src;
3051  int srcskip = info->src_skip;
3052  Uint8 *dst = info->dst;
3053  int dstskip = info->dst_skip;
3054  SDL_PixelFormat *srcfmt = info->src_fmt;
3055  int srcbpp = srcfmt->BytesPerPixel;
3056  SDL_PixelFormat *dstfmt = info->dst_fmt;
3057  int dstbpp = dstfmt->BytesPerPixel;
3058 
3059  if (dstfmt->Amask) {
3060  /* SET_ALPHA */
3061  Uint32 mask = ((Uint32)info->a) << dstfmt->Ashift;
3062 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
3063  int i0 = 0, i1 = 1, i2 = 2;
3064 #else
3065  int i0 = srcbpp - 1 - 0;
3066  int i1 = srcbpp - 1 - 1;
3067  int i2 = srcbpp - 1 - 2;
3068 #endif
3069  while (height--) {
3070  /* *INDENT-OFF* */
3071  DUFFS_LOOP(
3072  {
3073  Uint32 *dst32 = (Uint32*)dst;
3074  Uint8 s0 = src[i0];
3075  Uint8 s1 = src[i1];
3076  Uint8 s2 = src[i2];
3077  *dst32 = (s0) | (s1 << 8) | (s2 << 16) | mask;
3078  dst += 4;
3079  src += srcbpp;
3080  }, width);
3081  /* *INDENT-ON* */
3082  src += srcskip;
3083  dst += dstskip;
3084  }
3085  } else {
3086  /* NO_ALPHA */
3087 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
3088  int i0 = 0, i1 = 1, i2 = 2;
3089  int j0 = 0, j1 = 1, j2 = 2;
3090 #else
3091  int i0 = srcbpp - 1 - 0;
3092  int i1 = srcbpp - 1 - 1;
3093  int i2 = srcbpp - 1 - 2;
3094  int j0 = dstbpp - 1 - 0;
3095  int j1 = dstbpp - 1 - 1;
3096  int j2 = dstbpp - 1 - 2;
3097 #endif
3098  while (height--) {
3099  /* *INDENT-OFF* */
3100  DUFFS_LOOP(
3101  {
3102  Uint8 s0 = src[i0];
3103  Uint8 s1 = src[i1];
3104  Uint8 s2 = src[i2];
3105  dst[j0] = s0;
3106  dst[j1] = s1;
3107  dst[j2] = s2;
3108  dst += dstbpp;
3109  src += srcbpp;
3110  }, width);
3111  /* *INDENT-ON* */
3112  src += srcskip;
3113  dst += dstskip;
3114  }
3115  }
3116 }

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 1098 of file SDL_blit_N.c.

1099 {
1100 #ifndef USE_DUFFS_LOOP
1101  int c;
1102 #endif
1103  int width, height;
1104  Uint32 *src;
1105  const Uint8 *map;
1106  Uint8 *dst;
1107  int srcskip, dstskip;
1108 
1109  /* Set up some basic variables */
1110  width = info->dst_w;
1111  height = info->dst_h;
1112  src = (Uint32 *) info->src;
1113  srcskip = info->src_skip / 4;
1114  dst = info->dst;
1115  dstskip = info->dst_skip;
1116  map = info->table;
1117 
1118  if (map == NULL) {
1119  while (height--) {
1120 #ifdef USE_DUFFS_LOOP
1121  /* *INDENT-OFF* */
1122  DUFFS_LOOP(
1123  RGB101010_RGB332(*dst++, *src);
1124  , width);
1125  /* *INDENT-ON* */
1126 #else
1127  for (c = width / 4; c; --c) {
1128  /* Pack RGB into 8bit pixel */
1129  ++src;
1130  RGB101010_RGB332(*dst++, *src);
1131  ++src;
1132  RGB101010_RGB332(*dst++, *src);
1133  ++src;
1134  RGB101010_RGB332(*dst++, *src);
1135  ++src;
1136  }
1137  switch (width & 3) {
1138  case 3:
1139  RGB101010_RGB332(*dst++, *src);
1140  ++src;
1141  case 2:
1142  RGB101010_RGB332(*dst++, *src);
1143  ++src;
1144  case 1:
1145  RGB101010_RGB332(*dst++, *src);
1146  ++src;
1147  }
1148 #endif /* USE_DUFFS_LOOP */
1149  src += srcskip;
1150  dst += dstskip;
1151  }
1152  } else {
1153  int Pixel;
1154 
1155  while (height--) {
1156 #ifdef USE_DUFFS_LOOP
1157  /* *INDENT-OFF* */
1158  DUFFS_LOOP(
1159  RGB101010_RGB332(Pixel, *src);
1160  *dst++ = map[Pixel];
1161  ++src;
1162  , width);
1163  /* *INDENT-ON* */
1164 #else
1165  for (c = width / 4; c; --c) {
1166  /* Pack RGB into 8bit pixel */
1167  RGB101010_RGB332(Pixel, *src);
1168  *dst++ = map[Pixel];
1169  ++src;
1170  RGB101010_RGB332(Pixel, *src);
1171  *dst++ = map[Pixel];
1172  ++src;
1173  RGB101010_RGB332(Pixel, *src);
1174  *dst++ = map[Pixel];
1175  ++src;
1176  RGB101010_RGB332(Pixel, *src);
1177  *dst++ = map[Pixel];
1178  ++src;
1179  }
1180  switch (width & 3) {
1181  case 3:
1182  RGB101010_RGB332(Pixel, *src);
1183  *dst++ = map[Pixel];
1184  ++src;
1185  case 2:
1186  RGB101010_RGB332(Pixel, *src);
1187  *dst++ = map[Pixel];
1188  ++src;
1189  case 1:
1190  RGB101010_RGB332(Pixel, *src);
1191  *dst++ = map[Pixel];
1192  ++src;
1193  }
1194 #endif /* USE_DUFFS_LOOP */
1195  src += srcskip;
1196  dst += dstskip;
1197  }
1198  }
1199 }
#define RGB101010_RGB332(dst, src)
Definition: SDL_blit_N.c:1092
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
const GLubyte * c
#define NULL
Definition: begin_code.h:163
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
Uint8 * table
Definition: SDL_blit.h:68

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

◆ Blit_RGB565_32()

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

Definition at line 1459 of file SDL_blit_N.c.

1460 {
1461 #ifndef USE_DUFFS_LOOP
1462  int c;
1463 #endif
1464  int width, height;
1465  Uint8 *src;
1466  Uint32 *dst;
1467  int srcskip, dstskip;
1468 
1469  /* Set up some basic variables */
1470  width = info->dst_w;
1471  height = info->dst_h;
1472  src = info->src;
1473  srcskip = info->src_skip;
1474  dst = (Uint32 *) info->dst;
1475  dstskip = info->dst_skip / 4;
1476 
1477 #ifdef USE_DUFFS_LOOP
1478  while (height--) {
1479  /* *INDENT-OFF* */
1480  DUFFS_LOOP(
1481  {
1482  *dst++ = RGB565_32(dst, src, map);
1483  src += 2;
1484  },
1485  width);
1486  /* *INDENT-ON* */
1487  src += srcskip;
1488  dst += dstskip;
1489  }
1490 #else
1491  while (height--) {
1492  /* Copy in 4 pixel chunks */
1493  for (c = width / 4; c; --c) {
1494  *dst++ = RGB565_32(dst, src, map);
1495  src += 2;
1496  *dst++ = RGB565_32(dst, src, map);
1497  src += 2;
1498  *dst++ = RGB565_32(dst, src, map);
1499  src += 2;
1500  *dst++ = RGB565_32(dst, src, map);
1501  src += 2;
1502  }
1503  /* Get any leftovers */
1504  switch (width & 3) {
1505  case 3:
1506  *dst++ = RGB565_32(dst, src, map);
1507  src += 2;
1508  case 2:
1509  *dst++ = RGB565_32(dst, src, map);
1510  src += 2;
1511  case 1:
1512  *dst++ = RGB565_32(dst, src, map);
1513  src += 2;
1514  break;
1515  }
1516  src += srcskip;
1517  dst += dstskip;
1518  }
1519 #endif /* USE_DUFFS_LOOP */
1520 }
#define USE_DUFFS_LOOP
Definition: SDL_blit.h:468
#define RGB565_32(dst, src, map)
Definition: SDL_blit_N.c:1457

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

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 1793 of file SDL_blit_N.c.

1794 {
1796 }
static void Blit_RGB565_32(SDL_BlitInfo *info, const Uint32 *map)
Definition: SDL_blit_N.c:1459
static const Uint32 RGB565_ABGR8888_LUT[512]
Definition: SDL_blit_N.c:1661

References Blit_RGB565_32(), and RGB565_ABGR8888_LUT.

◆ Blit_RGB565_ARGB8888()

static void Blit_RGB565_ARGB8888 ( SDL_BlitInfo info)
static

Definition at line 1655 of file SDL_blit_N.c.

1656 {
1658 }
static const Uint32 RGB565_ARGB8888_LUT[512]
Definition: SDL_blit_N.c:1523

References Blit_RGB565_32(), and RGB565_ARGB8888_LUT.

◆ Blit_RGB565_BGRA8888()

static void Blit_RGB565_BGRA8888 ( SDL_BlitInfo info)
static

Definition at line 2069 of file SDL_blit_N.c.

2070 {
2072 }
static const Uint32 RGB565_BGRA8888_LUT[512]
Definition: SDL_blit_N.c:1937

References Blit_RGB565_32(), and RGB565_BGRA8888_LUT.

◆ Blit_RGB565_RGBA8888()

static void Blit_RGB565_RGBA8888 ( SDL_BlitInfo info)
static

Definition at line 1931 of file SDL_blit_N.c.

1932 {
1934 }
static const Uint32 RGB565_RGBA8888_LUT[512]
Definition: SDL_blit_N.c:1799

References Blit_RGB565_32(), and RGB565_RGBA8888_LUT.

◆ Blit_RGB888_index8()

static void Blit_RGB888_index8 ( SDL_BlitInfo info)
static

Definition at line 988 of file SDL_blit_N.c.

989 {
990 #ifndef USE_DUFFS_LOOP
991  int c;
992 #endif
993  int width, height;
994  Uint32 *src;
995  const Uint8 *map;
996  Uint8 *dst;
997  int srcskip, dstskip;
998 
999  /* Set up some basic variables */
1000  width = info->dst_w;
1001  height = info->dst_h;
1002  src = (Uint32 *) info->src;
1003  srcskip = info->src_skip / 4;
1004  dst = info->dst;
1005  dstskip = info->dst_skip;
1006  map = info->table;
1007 
1008  if (map == NULL) {
1009  while (height--) {
1010 #ifdef USE_DUFFS_LOOP
1011  /* *INDENT-OFF* */
1012  DUFFS_LOOP(
1013  RGB888_RGB332(*dst++, *src);
1014  , width);
1015  /* *INDENT-ON* */
1016 #else
1017  for (c = width / 4; c; --c) {
1018  /* Pack RGB into 8bit pixel */
1019  ++src;
1020  RGB888_RGB332(*dst++, *src);
1021  ++src;
1022  RGB888_RGB332(*dst++, *src);
1023  ++src;
1024  RGB888_RGB332(*dst++, *src);
1025  ++src;
1026  }
1027  switch (width & 3) {
1028  case 3:
1029  RGB888_RGB332(*dst++, *src);
1030  ++src;
1031  case 2:
1032  RGB888_RGB332(*dst++, *src);
1033  ++src;
1034  case 1:
1035  RGB888_RGB332(*dst++, *src);
1036  ++src;
1037  }
1038 #endif /* USE_DUFFS_LOOP */
1039  src += srcskip;
1040  dst += dstskip;
1041  }
1042  } else {
1043  int Pixel;
1044 
1045  while (height--) {
1046 #ifdef USE_DUFFS_LOOP
1047  /* *INDENT-OFF* */
1048  DUFFS_LOOP(
1049  RGB888_RGB332(Pixel, *src);
1050  *dst++ = map[Pixel];
1051  ++src;
1052  , width);
1053  /* *INDENT-ON* */
1054 #else
1055  for (c = width / 4; c; --c) {
1056  /* Pack RGB into 8bit pixel */
1057  RGB888_RGB332(Pixel, *src);
1058  *dst++ = map[Pixel];
1059  ++src;
1060  RGB888_RGB332(Pixel, *src);
1061  *dst++ = map[Pixel];
1062  ++src;
1063  RGB888_RGB332(Pixel, *src);
1064  *dst++ = map[Pixel];
1065  ++src;
1066  RGB888_RGB332(Pixel, *src);
1067  *dst++ = map[Pixel];
1068  ++src;
1069  }
1070  switch (width & 3) {
1071  case 3:
1072  RGB888_RGB332(Pixel, *src);
1073  *dst++ = map[Pixel];
1074  ++src;
1075  case 2:
1076  RGB888_RGB332(Pixel, *src);
1077  *dst++ = map[Pixel];
1078  ++src;
1079  case 1:
1080  RGB888_RGB332(Pixel, *src);
1081  *dst++ = map[Pixel];
1082  ++src;
1083  }
1084 #endif /* USE_DUFFS_LOOP */
1085  src += srcskip;
1086  dst += dstskip;
1087  }
1088  }
1089 }
#define RGB888_RGB332(dst, src)
Definition: SDL_blit_N.c:982

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

◆ Blit_RGB888_RGB555()

static void Blit_RGB888_RGB555 ( SDL_BlitInfo info)
static

Definition at line 1218 of file SDL_blit_N.c.

1219 {
1220 #ifndef USE_DUFFS_LOOP
1221  int c;
1222 #endif
1223  int width, height;
1224  Uint32 *src;
1225  Uint16 *dst;
1226  int srcskip, dstskip;
1227 
1228  /* Set up some basic variables */
1229  width = info->dst_w;
1230  height = info->dst_h;
1231  src = (Uint32 *) info->src;
1232  srcskip = info->src_skip / 4;
1233  dst = (Uint16 *) info->dst;
1234  dstskip = info->dst_skip / 2;
1235 
1236 #ifdef USE_DUFFS_LOOP
1237  while (height--) {
1238  /* *INDENT-OFF* */
1239  DUFFS_LOOP(
1240  RGB888_RGB555(dst, src);
1241  ++src;
1242  ++dst;
1243  , width);
1244  /* *INDENT-ON* */
1245  src += srcskip;
1246  dst += dstskip;
1247  }
1248 #else
1249  /* Memory align at 4-byte boundary, if necessary */
1250  if ((long) dst & 0x03) {
1251  /* Don't do anything if width is 0 */
1252  if (width == 0) {
1253  return;
1254  }
1255  --width;
1256 
1257  while (height--) {
1258  /* Perform copy alignment */
1259  RGB888_RGB555(dst, src);
1260  ++src;
1261  ++dst;
1262 
1263  /* Copy in 4 pixel chunks */
1264  for (c = width / 4; c; --c) {
1265  RGB888_RGB555_TWO(dst, src);
1266  src += 2;
1267  dst += 2;
1268  RGB888_RGB555_TWO(dst, src);
1269  src += 2;
1270  dst += 2;
1271  }
1272  /* Get any leftovers */
1273  switch (width & 3) {
1274  case 3:
1275  RGB888_RGB555(dst, src);
1276  ++src;
1277  ++dst;
1278  case 2:
1279  RGB888_RGB555_TWO(dst, src);
1280  src += 2;
1281  dst += 2;
1282  break;
1283  case 1:
1284  RGB888_RGB555(dst, src);
1285  ++src;
1286  ++dst;
1287  break;
1288  }
1289  src += srcskip;
1290  dst += dstskip;
1291  }
1292  } else {
1293  while (height--) {
1294  /* Copy in 4 pixel chunks */
1295  for (c = width / 4; c; --c) {
1296  RGB888_RGB555_TWO(dst, src);
1297  src += 2;
1298  dst += 2;
1299  RGB888_RGB555_TWO(dst, src);
1300  src += 2;
1301  dst += 2;
1302  }
1303  /* Get any leftovers */
1304  switch (width & 3) {
1305  case 3:
1306  RGB888_RGB555(dst, src);
1307  ++src;
1308  ++dst;
1309  case 2:
1310  RGB888_RGB555_TWO(dst, src);
1311  src += 2;
1312  dst += 2;
1313  break;
1314  case 1:
1315  RGB888_RGB555(dst, src);
1316  ++src;
1317  ++dst;
1318  break;
1319  }
1320  src += srcskip;
1321  dst += dstskip;
1322  }
1323  }
1324 #endif /* USE_DUFFS_LOOP */
1325 }
#define RGB888_RGB555(dst, src)
Definition: SDL_blit_N.c:1202

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 1344 of file SDL_blit_N.c.

1345 {
1346 #ifndef USE_DUFFS_LOOP
1347  int c;
1348 #endif
1349  int width, height;
1350  Uint32 *src;
1351  Uint16 *dst;
1352  int srcskip, dstskip;
1353 
1354  /* Set up some basic variables */
1355  width = info->dst_w;
1356  height = info->dst_h;
1357  src = (Uint32 *) info->src;
1358  srcskip = info->src_skip / 4;
1359  dst = (Uint16 *) info->dst;
1360  dstskip = info->dst_skip / 2;
1361 
1362 #ifdef USE_DUFFS_LOOP
1363  while (height--) {
1364  /* *INDENT-OFF* */
1365  DUFFS_LOOP(
1366  RGB888_RGB565(dst, src);
1367  ++src;
1368  ++dst;
1369  , width);
1370  /* *INDENT-ON* */
1371  src += srcskip;
1372  dst += dstskip;
1373  }
1374 #else
1375  /* Memory align at 4-byte boundary, if necessary */
1376  if ((long) dst & 0x03) {
1377  /* Don't do anything if width is 0 */
1378  if (width == 0) {
1379  return;
1380  }
1381  --width;
1382 
1383  while (height--) {
1384  /* Perform copy alignment */
1385  RGB888_RGB565(dst, src);
1386  ++src;
1387  ++dst;
1388 
1389  /* Copy in 4 pixel chunks */
1390  for (c = width / 4; c; --c) {
1391  RGB888_RGB565_TWO(dst, src);
1392  src += 2;
1393  dst += 2;
1394  RGB888_RGB565_TWO(dst, src);
1395  src += 2;
1396  dst += 2;
1397  }
1398  /* Get any leftovers */
1399  switch (width & 3) {
1400  case 3:
1401  RGB888_RGB565(dst, src);
1402  ++src;
1403  ++dst;
1404  case 2:
1405  RGB888_RGB565_TWO(dst, src);
1406  src += 2;
1407  dst += 2;
1408  break;
1409  case 1:
1410  RGB888_RGB565(dst, src);
1411  ++src;
1412  ++dst;
1413  break;
1414  }
1415  src += srcskip;
1416  dst += dstskip;
1417  }
1418  } else {
1419  while (height--) {
1420  /* Copy in 4 pixel chunks */
1421  for (c = width / 4; c; --c) {
1422  RGB888_RGB565_TWO(dst, src);
1423  src += 2;
1424  dst += 2;
1425  RGB888_RGB565_TWO(dst, src);
1426  src += 2;
1427  dst += 2;
1428  }
1429  /* Get any leftovers */
1430  switch (width & 3) {
1431  case 3:
1432  RGB888_RGB565(dst, src);
1433  ++src;
1434  ++dst;
1435  case 2:
1436  RGB888_RGB565_TWO(dst, src);
1437  src += 2;
1438  dst += 2;
1439  break;
1440  case 1:
1441  RGB888_RGB565(dst, src);
1442  ++src;
1443  ++dst;
1444  break;
1445  }
1446  src += srcskip;
1447  dst += dstskip;
1448  }
1449  }
1450 #endif /* USE_DUFFS_LOOP */
1451 }
#define RGB888_RGB565(dst, src)
Definition: SDL_blit_N.c:1328

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 2077 of file SDL_blit_N.c.

2078 {
2079 #ifndef USE_DUFFS_LOOP
2080  int c;
2081 #endif
2082  int width, height;
2083  Uint8 *src;
2084  const Uint8 *map;
2085  Uint8 *dst;
2086  int srcskip, dstskip;
2087  int srcbpp;
2088  Uint32 Pixel;
2089  int sR, sG, sB;
2090  SDL_PixelFormat *srcfmt;
2091 
2092  /* Set up some basic variables */
2093  width = info->dst_w;
2094  height = info->dst_h;
2095  src = info->src;
2096  srcskip = info->src_skip;
2097  dst = info->dst;
2098  dstskip = info->dst_skip;
2099  map = info->table;
2100  srcfmt = info->src_fmt;
2101  srcbpp = srcfmt->BytesPerPixel;
2102 
2103  if (map == NULL) {
2104  while (height--) {
2105 #ifdef USE_DUFFS_LOOP
2106  /* *INDENT-OFF* */
2107  DUFFS_LOOP(
2108  DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
2109  sR, sG, sB);
2110  if ( 1 ) {
2111  /* Pack RGB into 8bit pixel */
2112  *dst = ((sR>>5)<<(3+2))|
2113  ((sG>>5)<<(2)) |
2114  ((sB>>6)<<(0)) ;
2115  }
2116  dst++;
2117  src += srcbpp;
2118  , width);
2119  /* *INDENT-ON* */
2120 #else
2121  for (c = width; c; --c) {
2122  DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
2123  if (1) {
2124  /* Pack RGB into 8bit pixel */
2125  *dst = ((sR >> 5) << (3 + 2)) |
2126  ((sG >> 5) << (2)) | ((sB >> 6) << (0));
2127  }
2128  dst++;
2129  src += srcbpp;
2130  }
2131 #endif
2132  src += srcskip;
2133  dst += dstskip;
2134  }
2135  } else {
2136  while (height--) {
2137 #ifdef USE_DUFFS_LOOP
2138  /* *INDENT-OFF* */
2139  DUFFS_LOOP(
2140  DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
2141  sR, sG, sB);
2142  if ( 1 ) {
2143  /* Pack RGB into 8bit pixel */
2144  *dst = map[((sR>>5)<<(3+2))|
2145  ((sG>>5)<<(2)) |
2146  ((sB>>6)<<(0)) ];
2147  }
2148  dst++;
2149  src += srcbpp;
2150  , width);
2151  /* *INDENT-ON* */
2152 #else
2153  for (c = width; c; --c) {
2154  DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
2155  if (1) {
2156  /* Pack RGB into 8bit pixel */
2157  *dst = map[((sR >> 5) << (3 + 2)) |
2158  ((sG >> 5) << (2)) | ((sB >> 6) << (0))];
2159  }
2160  dst++;
2161  src += srcbpp;
2162  }
2163 #endif /* USE_DUFFS_LOOP */
2164  src += srcskip;
2165  dst += dstskip;
2166  }
2167  }
2168 }
#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b)
Definition: SDL_blit.h:178

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 2506 of file SDL_blit_N.c.

2507 {
2508  int width = info->dst_w;
2509  int height = info->dst_h;
2510  Uint8 *src = info->src;
2511  int srcskip = info->src_skip;
2512  Uint8 *dst = info->dst;
2513  int dstskip = info->dst_skip;
2514  SDL_PixelFormat *srcfmt = info->src_fmt;
2515  const Uint8 *palmap = info->table;
2516  Uint32 ckey = info->colorkey;
2517  Uint32 rgbmask = ~srcfmt->Amask;
2518  int srcbpp;
2519  Uint32 Pixel;
2520  unsigned sR, sG, sB;
2521 
2522  /* Set up some basic variables */
2523  srcbpp = srcfmt->BytesPerPixel;
2524  ckey &= rgbmask;
2525 
2526  if (palmap == NULL) {
2527  while (height--) {
2528  /* *INDENT-OFF* */
2529  DUFFS_LOOP(
2530  {
2531  DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
2532  sR, sG, sB);
2533  if ( (Pixel & rgbmask) != ckey ) {
2534  /* Pack RGB into 8bit pixel */
2535  *dst = (Uint8)(((sR>>5)<<(3+2))|
2536  ((sG>>5)<<(2)) |
2537  ((sB>>6)<<(0)));
2538  }
2539  dst++;
2540  src += srcbpp;
2541  },
2542  width);
2543  /* *INDENT-ON* */
2544  src += srcskip;
2545  dst += dstskip;
2546  }
2547  } else {
2548  while (height--) {
2549  /* *INDENT-OFF* */
2550  DUFFS_LOOP(
2551  {
2552  DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
2553  sR, sG, sB);
2554  if ( (Pixel & rgbmask) != ckey ) {
2555  /* Pack RGB into 8bit pixel */
2556  *dst = (Uint8)palmap[((sR>>5)<<(3+2))|
2557  ((sG>>5)<<(2)) |
2558  ((sB>>6)<<(0)) ];
2559  }
2560  dst++;
2561  src += srcbpp;
2562  },
2563  width);
2564  /* *INDENT-ON* */
2565  src += srcskip;
2566  dst += dstskip;
2567  }
2568  }
2569 }

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 3014 of file SDL_blit_N.c.

3015 {
3016  int width = info->dst_w;
3017  int height = info->dst_h;
3018  Uint8 *src = info->src;
3019  int srcskip = info->src_skip;
3020  Uint8 *dst = info->dst;
3021  int dstskip = info->dst_skip;
3022  SDL_PixelFormat *srcfmt = info->src_fmt;
3023  int srcbpp = srcfmt->BytesPerPixel;
3024  Uint32 Pixel;
3025  unsigned sR, sG, sB, sA;
3026 
3027  while (height--) {
3028  /* *INDENT-OFF* */
3029  DUFFS_LOOP(
3030  {
3031  DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
3032  ARGB2101010_FROM_RGBA(Pixel, sR, sG, sB, sA);
3033  *(Uint32 *)dst = Pixel;
3034  dst += 4;
3035  src += srcbpp;
3036  },
3037  width);
3038  /* *INDENT-ON* */
3039  src += srcskip;
3040  dst += dstskip;
3041  }
3042 }
#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)
Definition: SDL_blit.h:354
#define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a)
Definition: SDL_blit.h:254

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 2329 of file SDL_blit_N.c.

2330 {
2331  int width = info->dst_w;
2332  int height = info->dst_h;
2333  Uint8 *src = info->src;
2334  int srcskip = info->src_skip;
2335  Uint8 *dst = info->dst;
2336  int dstskip = info->dst_skip;
2337  SDL_PixelFormat *srcfmt = info->src_fmt;
2338  int srcbpp = srcfmt->BytesPerPixel;
2339  SDL_PixelFormat *dstfmt = info->dst_fmt;
2340  int dstbpp = dstfmt->BytesPerPixel;
2341  unsigned alpha = dstfmt->Amask ? info->a : 0;
2342 
2343 #if HAVE_FAST_WRITE_INT8
2344  /* Blit with permutation: 4->4 */
2345  if (srcbpp == 4 && dstbpp == 4 &&
2346  srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
2347  dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
2348 
2349  /* Find the appropriate permutation */
2350  int alpha_channel, p0, p1, p2, p3;
2351  get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, &alpha_channel);
2352 
2353  while (height--) {
2354  /* *INDENT-OFF* */
2355  DUFFS_LOOP(
2356  {
2357  dst[0] = src[p0];
2358  dst[1] = src[p1];
2359  dst[2] = src[p2];
2360  dst[3] = src[p3];
2361  dst[alpha_channel] = alpha;
2362  src += 4;
2363  dst += 4;
2364  }, width);
2365  /* *INDENT-ON* */
2366  src += srcskip;
2367  dst += dstskip;
2368  }
2369  return;
2370  }
2371 #endif
2372 
2373  /* Blit with permutation: 4->3 */
2374  if (srcbpp == 4 && dstbpp == 3 &&
2375  srcfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
2376 
2377  /* Find the appropriate permutation */
2378  int p0, p1, p2, p3;
2379  get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, NULL);
2380 
2381  while (height--) {
2382  /* *INDENT-OFF* */
2383  DUFFS_LOOP(
2384  {
2385  dst[0] = src[p0];
2386  dst[1] = src[p1];
2387  dst[2] = src[p2];
2388  src += 4;
2389  dst += 3;
2390  }, width);
2391  /* *INDENT-ON* */
2392  src += srcskip;
2393  dst += dstskip;
2394  }
2395  return;
2396  }
2397 
2398 #if HAVE_FAST_WRITE_INT8
2399  /* Blit with permutation: 3->4 */
2400  if (srcbpp == 3 && dstbpp == 4 &&
2401  dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
2402 
2403  /* Find the appropriate permutation */
2404  int alpha_channel, p0, p1, p2, p3;
2405  get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, &alpha_channel);
2406 
2407  while (height--) {
2408  /* *INDENT-OFF* */
2409  DUFFS_LOOP(
2410  {
2411  dst[0] = src[p0];
2412  dst[1] = src[p1];
2413  dst[2] = src[p2];
2414  dst[3] = src[p3];
2415  dst[alpha_channel] = alpha;
2416  src += 3;
2417  dst += 4;
2418  }, width);
2419  /* *INDENT-ON* */
2420  src += srcskip;
2421  dst += dstskip;
2422  }
2423  return;
2424  }
2425 #endif
2426 
2427  while (height--) {
2428  /* *INDENT-OFF* */
2429  DUFFS_LOOP(
2430  {
2431  Uint32 Pixel;
2432  unsigned sR;
2433  unsigned sG;
2434  unsigned sB;
2435  DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
2436  ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
2437  dst += dstbpp;
2438  src += srcbpp;
2439  },
2440  width);
2441  /* *INDENT-ON* */
2442  src += srcskip;
2443  dst += dstskip;
2444  }
2445 }
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:2249
GLfloat GLfloat GLfloat alpha
@ SDL_PIXELFORMAT_ARGB2101010
Definition: SDL_pixels.h:269

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 2448 of file SDL_blit_N.c.

2449 {
2450  int width = info->dst_w;
2451  int height = info->dst_h;
2452  Uint8 *src = info->src;
2453  int srcskip = info->src_skip;
2454  Uint8 *dst = info->dst;
2455  int dstskip = info->dst_skip;
2456  SDL_PixelFormat *srcfmt = info->src_fmt;
2457  int srcbpp = srcfmt->BytesPerPixel;
2458  SDL_PixelFormat *dstfmt = info->dst_fmt;
2459  int dstbpp = dstfmt->BytesPerPixel;
2460  int c;
2461 
2462 #if HAVE_FAST_WRITE_INT8
2463  /* Blit with permutation: 4->4 */
2464  if (srcbpp == 4 && dstbpp == 4 &&
2465  srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
2466  dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
2467 
2468  /* Find the appropriate permutation */
2469  int p0, p1, p2, p3;
2470  get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, NULL);
2471 
2472  while (height--) {
2473  /* *INDENT-OFF* */
2474  DUFFS_LOOP(
2475  {
2476  dst[0] = src[p0];
2477  dst[1] = src[p1];
2478  dst[2] = src[p2];
2479  dst[3] = src[p3];
2480  src += 4;
2481  dst += 4;
2482  }, width);
2483  /* *INDENT-ON* */
2484  src += srcskip;
2485  dst += dstskip;
2486  }
2487  return;
2488  }
2489 #endif
2490 
2491  while (height--) {
2492  for (c = width; c; --c) {
2493  Uint32 Pixel;
2494  unsigned sR, sG, sB, sA;
2495  DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
2496  ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
2497  dst += dstbpp;
2498  src += srcbpp;
2499  }
2500  src += srcskip;
2501  dst += dstskip;
2502  }
2503 }

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 2606 of file SDL_blit_N.c.

2607 {
2608  int width = info->dst_w;
2609  int height = info->dst_h;
2610  Uint8 *src = info->src;
2611  int srcskip = info->src_skip;
2612  Uint8 *dst = info->dst;
2613  int dstskip = info->dst_skip;
2614  Uint32 ckey = info->colorkey;
2615  SDL_PixelFormat *srcfmt = info->src_fmt;
2616  SDL_PixelFormat *dstfmt = info->dst_fmt;
2617  int srcbpp = srcfmt->BytesPerPixel;
2618  int dstbpp = dstfmt->BytesPerPixel;
2619  unsigned alpha = dstfmt->Amask ? info->a : 0;
2620  Uint32 rgbmask = ~srcfmt->Amask;
2621  int sfmt = srcfmt->format;
2622  int dfmt = dstfmt->format;
2623 
2624  /* Set up some basic variables */
2625  ckey &= rgbmask;
2626 
2627  /* BPP 4, same rgb */
2628  if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask) {
2629  Uint32 *src32 = (Uint32*)src;
2630  Uint32 *dst32 = (Uint32*)dst;
2631 
2632  if (dstfmt->Amask) {
2633  /* RGB->RGBA, SET_ALPHA */
2634  Uint32 mask = ((Uint32)info->a) << dstfmt->Ashift;
2635  while (height--) {
2636  /* *INDENT-OFF* */
2637  DUFFS_LOOP(
2638  {
2639  if ((*src32 & rgbmask) != ckey) {
2640  *dst32 = *src32 | mask;
2641  }
2642  ++dst32;
2643  ++src32;
2644  }, width);
2645  /* *INDENT-ON* */
2646  src32 = (Uint32 *) ((Uint8 *) src32 + srcskip);
2647  dst32 = (Uint32 *) ((Uint8 *) dst32 + dstskip);
2648  }
2649  return;
2650  } else {
2651  /* RGBA->RGB, NO_ALPHA */
2652  Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
2653  while (height--) {
2654  /* *INDENT-OFF* */
2655  DUFFS_LOOP(
2656  {
2657  if ((*src32 & rgbmask) != ckey) {
2658  *dst32 = *src32 & mask;
2659  }
2660  ++dst32;
2661  ++src32;
2662  }, width);
2663  /* *INDENT-ON* */
2664  src32 = (Uint32 *) ((Uint8 *) src32 + srcskip);
2665  dst32 = (Uint32 *) ((Uint8 *) dst32 + dstskip);
2666  }
2667  return;
2668  }
2669  }
2670 
2671 #if HAVE_FAST_WRITE_INT8
2672  /* Blit with permutation: 4->4 */
2673  if (srcbpp == 4 && dstbpp == 4 &&
2674  srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
2675  dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
2676 
2677  /* Find the appropriate permutation */
2678  int alpha_channel, p0, p1, p2, p3;
2679  get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, &alpha_channel);
2680 
2681  while (height--) {
2682  /* *INDENT-OFF* */
2683  DUFFS_LOOP(
2684  {
2685  Uint32 *src32 = (Uint32*)src;
2686 
2687  if ((*src32 & rgbmask) != ckey) {
2688  dst[0] = src[p0];
2689  dst[1] = src[p1];
2690  dst[2] = src[p2];
2691  dst[3] = src[p3];
2692  dst[alpha_channel] = alpha;
2693  }
2694  src += 4;
2695  dst += 4;
2696  }, width);
2697  /* *INDENT-ON* */
2698  src += srcskip;
2699  dst += dstskip;
2700  }
2701  return;
2702  }
2703 #endif
2704 
2705  /* BPP 3, same rgb triplet */
2706  if ((sfmt == SDL_PIXELFORMAT_RGB24 && dfmt == SDL_PIXELFORMAT_RGB24) ||
2707  (sfmt == SDL_PIXELFORMAT_BGR24 && dfmt == SDL_PIXELFORMAT_BGR24)) {
2708 
2709 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
2710  Uint8 k0 = ckey & 0xFF;
2711  Uint8 k1 = (ckey >> 8) & 0xFF;
2712  Uint8 k2 = (ckey >> 16) & 0xFF;
2713 #else
2714  Uint8 k0 = (ckey >> 16) & 0xFF;
2715  Uint8 k1 = (ckey >> 8) & 0xFF;
2716  Uint8 k2 = ckey & 0xFF;
2717 #endif
2718 
2719  while (height--) {
2720  /* *INDENT-OFF* */
2721  DUFFS_LOOP(
2722  {
2723  Uint8 s0 = src[0];
2724  Uint8 s1 = src[1];
2725  Uint8 s2 = src[2];
2726 
2727  if (k0 != s0 || k1 != s1 || k2 != s2) {
2728  dst[0] = s0;
2729  dst[1] = s1;
2730  dst[2] = s2;
2731  }
2732  src += 3;
2733  dst += 3;
2734  },
2735  width);
2736  /* *INDENT-ON* */
2737  src += srcskip;
2738  dst += dstskip;
2739  }
2740  return;
2741  }
2742 
2743  /* BPP 3, inversed rgb triplet */
2744  if ((sfmt == SDL_PIXELFORMAT_RGB24 && dfmt == SDL_PIXELFORMAT_BGR24) ||
2745  (sfmt == SDL_PIXELFORMAT_BGR24 && dfmt == SDL_PIXELFORMAT_RGB24)) {
2746 
2747 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
2748  Uint8 k0 = ckey & 0xFF;
2749  Uint8 k1 = (ckey >> 8) & 0xFF;
2750  Uint8 k2 = (ckey >> 16) & 0xFF;
2751 #else
2752  Uint8 k0 = (ckey >> 16) & 0xFF;
2753  Uint8 k1 = (ckey >> 8) & 0xFF;
2754  Uint8 k2 = ckey & 0xFF;
2755 #endif
2756 
2757  while (height--) {
2758  /* *INDENT-OFF* */
2759  DUFFS_LOOP(
2760  {
2761  Uint8 s0 = src[0];
2762  Uint8 s1 = src[1];
2763  Uint8 s2 = src[2];
2764  if (k0 != s0 || k1 != s1 || k2 != s2) {
2765  /* Inversed RGB */
2766  dst[0] = s2;
2767  dst[1] = s1;
2768  dst[2] = s0;
2769  }
2770  src += 3;
2771  dst += 3;
2772  },
2773  width);
2774  /* *INDENT-ON* */
2775  src += srcskip;
2776  dst += dstskip;
2777  }
2778  return;
2779  }
2780 
2781  /* Blit with permutation: 4->3 */
2782  if (srcbpp == 4 && dstbpp == 3 &&
2783  srcfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
2784 
2785  /* Find the appropriate permutation */
2786  int p0, p1, p2, p3;
2787  get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, NULL);
2788 
2789  while (height--) {
2790  /* *INDENT-OFF* */
2791  DUFFS_LOOP(
2792  {
2793  Uint32 *src32 = (Uint32*)src;
2794  if ((*src32 & rgbmask) != ckey) {
2795  dst[0] = src[p0];
2796  dst[1] = src[p1];
2797  dst[2] = src[p2];
2798  }
2799  src += 4;
2800  dst += 3;
2801  }, width);
2802  /* *INDENT-ON* */
2803  src += srcskip;
2804  dst += dstskip;
2805  }
2806  return;
2807  }
2808 
2809 #if HAVE_FAST_WRITE_INT8
2810  /* Blit with permutation: 3->4 */
2811  if (srcbpp == 3 && dstbpp == 4 &&
2812  dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
2813 
2814 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
2815  Uint8 k0 = ckey & 0xFF;
2816  Uint8 k1 = (ckey >> 8) & 0xFF;
2817  Uint8 k2 = (ckey >> 16) & 0xFF;
2818 #else
2819  Uint8 k0 = (ckey >> 16) & 0xFF;
2820  Uint8 k1 = (ckey >> 8) & 0xFF;
2821  Uint8 k2 = ckey & 0xFF;
2822 #endif
2823 
2824  /* Find the appropriate permutation */
2825  int alpha_channel, p0, p1, p2, p3;
2826  get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, &alpha_channel);
2827 
2828  while (height--) {
2829  /* *INDENT-OFF* */
2830  DUFFS_LOOP(
2831  {
2832  Uint8 s0 = src[0];
2833  Uint8 s1 = src[1];
2834  Uint8 s2 = src[2];
2835 
2836  if (k0 != s0 || k1 != s1 || k2 != s2) {
2837  dst[0] = src[p0];
2838  dst[1] = src[p1];
2839  dst[2] = src[p2];
2840  dst[3] = src[p3];
2841  dst[alpha_channel] = alpha;
2842  }
2843  src += 3;
2844  dst += 4;
2845  }, width);
2846  /* *INDENT-ON* */
2847  src += srcskip;
2848  dst += dstskip;
2849  }
2850  return;
2851  }
2852 #endif
2853 
2854  while (height--) {
2855  /* *INDENT-OFF* */
2856  DUFFS_LOOP(
2857  {
2858  Uint32 Pixel;
2859  unsigned sR;
2860  unsigned sG;
2861  unsigned sB;
2862  RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
2863  if ( (Pixel & rgbmask) != ckey ) {
2864  RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
2865  ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
2866  }
2867  dst += dstbpp;
2868  src += srcbpp;
2869  },
2870  width);
2871  /* *INDENT-ON* */
2872  src += srcskip;
2873  dst += dstskip;
2874  }
2875 }
#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel)
Definition: SDL_blit.h:147
#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b)
Definition: SDL_blit.h:123
@ SDL_PIXELFORMAT_BGR24
Definition: SDL_pixels.h:240
@ SDL_PIXELFORMAT_RGB24
Definition: SDL_pixels.h:237

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 2878 of file SDL_blit_N.c.

2879 {
2880  int width = info->dst_w;
2881  int height = info->dst_h;
2882  Uint8 *src = info->src;
2883  int srcskip = info->src_skip;
2884  Uint8 *dst = info->dst;
2885  int dstskip = info->dst_skip;
2886  Uint32 ckey = info->colorkey;
2887  SDL_PixelFormat *srcfmt = info->src_fmt;
2888  SDL_PixelFormat *dstfmt = info->dst_fmt;
2889  Uint32 rgbmask = ~srcfmt->Amask;
2890 
2891  Uint8 srcbpp;
2892  Uint8 dstbpp;
2893  Uint32 Pixel;
2894  unsigned sR, sG, sB, sA;
2895 
2896  /* Set up some basic variables */
2897  srcbpp = srcfmt->BytesPerPixel;
2898  dstbpp = dstfmt->BytesPerPixel;
2899  ckey &= rgbmask;
2900 
2901  /* Fastpath: same source/destination format, with Amask, bpp 32, loop is vectorized. ~10x faster */
2902  if (srcfmt->format == dstfmt->format) {
2903 
2904  if (srcfmt->format == SDL_PIXELFORMAT_ARGB8888 ||
2905  srcfmt->format == SDL_PIXELFORMAT_ABGR8888 ||
2906  srcfmt->format == SDL_PIXELFORMAT_BGRA8888 ||
2907  srcfmt->format == SDL_PIXELFORMAT_RGBA8888) {
2908 
2909  Uint32 *src32 = (Uint32*)src;
2910  Uint32 *dst32 = (Uint32*)dst;
2911  while (height--) {
2912  /* *INDENT-OFF* */
2913  DUFFS_LOOP(
2914  {
2915  if ((*src32 & rgbmask) != ckey) {
2916  *dst32 = *src32;
2917  }
2918  ++src32;
2919  ++dst32;
2920  },
2921  width);
2922  /* *INDENT-ON* */
2923  src32 = (Uint32 *)((Uint8 *)src32 + srcskip);
2924  dst32 = (Uint32 *)((Uint8 *)dst32 + dstskip);
2925  }
2926  }
2927  return;
2928  }
2929 
2930 #if HAVE_FAST_WRITE_INT8
2931  /* Blit with permutation: 4->4 */
2932  if (srcbpp == 4 && dstbpp == 4 &&
2933  srcfmt->format != SDL_PIXELFORMAT_ARGB2101010 &&
2934  dstfmt->format != SDL_PIXELFORMAT_ARGB2101010) {
2935 
2936  /* Find the appropriate permutation */
2937  int p0, p1, p2, p3;
2938  get_permutation(srcfmt, dstfmt, &p0, &p1, &p2, &p3, NULL);
2939 
2940  while (height--) {
2941  /* *INDENT-OFF* */
2942  DUFFS_LOOP(
2943  {
2944  Uint32 *src32 = (Uint32*)src;
2945  if ((*src32 & rgbmask) != ckey) {
2946  dst[0] = src[p0];
2947  dst[1] = src[p1];
2948  dst[2] = src[p2];
2949  dst[3] = src[p3];
2950  }
2951  src += 4;
2952  dst += 4;
2953  }, width);
2954  /* *INDENT-ON* */
2955  src += srcskip;
2956  dst += dstskip;
2957  }
2958  return;
2959  }
2960 #endif
2961 
2962  while (height--) {
2963  /* *INDENT-OFF* */
2964  DUFFS_LOOP(
2965  {
2966  DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
2967  if ( (Pixel & rgbmask) != ckey ) {
2968  ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
2969  }
2970  dst += dstbpp;
2971  src += srcbpp;
2972  },
2973  width);
2974  /* *INDENT-ON* */
2975  src += srcskip;
2976  dst += dstskip;
2977  }
2978 }
@ SDL_PIXELFORMAT_RGBA8888
Definition: SDL_pixels.h:260
@ SDL_PIXELFORMAT_ABGR8888
Definition: SDL_pixels.h:263
@ SDL_PIXELFORMAT_BGRA8888
Definition: SDL_pixels.h:266
@ SDL_PIXELFORMAT_ARGB8888
Definition: SDL_pixels.h:257

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 2249 of file SDL_blit_N.c.

2251 {
2252  int alpha_channel = 0, p0, p1, p2, p3;
2253 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
2254  int Pixel = 0x04030201; /* identity permutation */
2255 #else
2256  int Pixel = 0x01020304; /* identity permutation */
2257  int srcbpp = srcfmt->BytesPerPixel;
2258  int dstbpp = dstfmt->BytesPerPixel;
2259 #endif
2260 
2261  if (srcfmt->Amask) {
2262  RGBA_FROM_PIXEL(Pixel, srcfmt, p0, p1, p2, p3);
2263  } else {
2264  RGB_FROM_PIXEL(Pixel, srcfmt, p0, p1, p2);
2265  p3 = 0;
2266  }
2267 
2268  if (dstfmt->Amask) {
2269  if (srcfmt->Amask) {
2270  PIXEL_FROM_RGBA(Pixel, dstfmt, p0, p1, p2, p3);
2271  } else {
2272  PIXEL_FROM_RGBA(Pixel, dstfmt, p0, p1, p2, 0);
2273  }
2274  } else {
2275  PIXEL_FROM_RGB(Pixel, dstfmt, p0, p1, p2);
2276  }
2277 
2278 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
2279  p0 = Pixel & 0xFF;
2280  p1 = (Pixel >> 8) & 0xFF;
2281  p2 = (Pixel >> 16) & 0xFF;
2282  p3 = (Pixel >> 24) & 0xFF;
2283 #else
2284  p3 = Pixel & 0xFF;
2285  p2 = (Pixel >> 8) & 0xFF;
2286  p1 = (Pixel >> 16) & 0xFF;
2287  p0 = (Pixel >> 24) & 0xFF;
2288 #endif
2289 
2290  if (p0 == 0) {
2291  p0 = 1;
2292  alpha_channel = 0;
2293  } else if (p1 == 0) {
2294  p1 = 1;
2295  alpha_channel = 1;
2296  } else if (p2 == 0) {
2297  p2 = 1;
2298  alpha_channel = 2;
2299  } else if (p3 == 0) {
2300  p3 = 1;
2301  alpha_channel = 3;
2302  }
2303 
2304 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
2305 #else
2306  if (srcbpp == 3 && dstbpp == 4) {
2307  if (p0 != 1) p0--;
2308  if (p1 != 1) p1--;
2309  if (p2 != 1) p2--;
2310  if (p3 != 1) p3--;
2311  } else if (srcbpp == 4 && dstbpp == 3) {
2312  p0 = p1;
2313  p1 = p2;
2314  p2 = p3;
2315  }
2316 #endif
2317  *_p0 = p0 - 1;
2318  *_p1 = p1 - 1;
2319  *_p2 = p2 - 1;
2320  *_p3 = p3 - 1;
2321 
2322  if (_alpha_channel) {
2323  *_alpha_channel = alpha_channel;
2324  }
2325 }
#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b)
Definition: SDL_blit.h:219
#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a)
Definition: SDL_blit.h:305
#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)
Definition: SDL_blit.h:396

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 3359 of file SDL_blit_N.c.

3360 {
3361  SDL_PixelFormat *srcfmt;
3362  SDL_PixelFormat *dstfmt;
3363  const struct blit_table *table;
3364  int which;
3365  SDL_BlitFunc blitfun;
3366 
3367  /* Set up data for choosing the blit */
3368  srcfmt = surface->format;
3369  dstfmt = surface->map->dst->format;
3370 
3371  /* We don't support destinations less than 8-bits */
3372  if (dstfmt->BitsPerPixel < 8) {
3373  return (NULL);
3374  }
3375 
3376  switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
3377  case 0:
3378  blitfun = NULL;
3379  if (dstfmt->BitsPerPixel == 8) {
3380  if ((srcfmt->BytesPerPixel == 4) &&
3381  (srcfmt->Rmask == 0x00FF0000) &&
3382  (srcfmt->Gmask == 0x0000FF00) &&
3383  (srcfmt->Bmask == 0x000000FF)) {
3384  blitfun = Blit_RGB888_index8;
3385  } else if ((srcfmt->BytesPerPixel == 4) &&
3386  (srcfmt->Rmask == 0x3FF00000) &&
3387  (srcfmt->Gmask == 0x000FFC00) &&
3388  (srcfmt->Bmask == 0x000003FF)) {
3389  blitfun = Blit_RGB101010_index8;
3390  } else {
3391  blitfun = BlitNto1;
3392  }
3393  } else {
3394  /* Now the meat, choose the blitter we want */
3395  Uint32 a_need = NO_ALPHA;
3396  if (dstfmt->Amask)
3397  a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
3398  table = normal_blit[srcfmt->BytesPerPixel - 1];
3399  for (which = 0; table[which].dstbpp; ++which) {
3400  if (MASKOK(srcfmt->Rmask, table[which].srcR) &&
3401  MASKOK(srcfmt->Gmask, table[which].srcG) &&
3402  MASKOK(srcfmt->Bmask, table[which].srcB) &&
3403  MASKOK(dstfmt->Rmask, table[which].dstR) &&
3404  MASKOK(dstfmt->Gmask, table[which].dstG) &&
3405  MASKOK(dstfmt->Bmask, table[which].dstB) &&
3406  dstfmt->BytesPerPixel == table[which].dstbpp &&
3407  (a_need & table[which].alpha) == a_need &&
3408  ((table[which].blit_features & GetBlitFeatures()) ==
3409  table[which].blit_features))
3410  break;
3411  }
3412  blitfun = table[which].blitfunc;
3413 
3414  if (blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */
3415  if (srcfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
3416  blitfun = Blit2101010toN;
3417  } else if (dstfmt->format == SDL_PIXELFORMAT_ARGB2101010) {
3418  blitfun = BlitNto2101010;
3419  } else if (srcfmt->BytesPerPixel == 4 &&
3420  dstfmt->BytesPerPixel == 4 &&
3421  srcfmt->Rmask == dstfmt->Rmask &&
3422  srcfmt->Gmask == dstfmt->Gmask &&
3423  srcfmt->Bmask == dstfmt->Bmask) {
3424  if (a_need == COPY_ALPHA) {
3425  if (srcfmt->Amask == dstfmt->Amask) {
3426  /* Fastpath C fallback: 32bit RGBA<->RGBA blit with matching RGBA */
3427  blitfun = Blit4to4CopyAlpha;
3428  } else {
3429  blitfun = BlitNtoNCopyAlpha;
3430  }
3431  } else {
3432  /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
3433  blitfun = Blit4to4MaskAlpha;
3434  }
3435  } else if (a_need == COPY_ALPHA) {
3436  blitfun = BlitNtoNCopyAlpha;
3437  }
3438  }
3439  }
3440  return (blitfun);
3441 
3442  case SDL_COPY_COLORKEY:
3443  /* colorkey blit: Here we don't have too many options, mostly
3444  because RLE is the preferred fast way to deal with this.
3445  If a particular case turns out to be useful we'll add it. */
3446 
3447  if (srcfmt->BytesPerPixel == 2 && surface->map->identity)
3448  return Blit2to2Key;
3449  else if (dstfmt->BytesPerPixel == 1)
3450  return BlitNto1Key;
3451  else {
3452 #if SDL_ALTIVEC_BLITTERS
3453  if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4)
3454  && SDL_HasAltiVec()) {
3455  return Blit32to32KeyAltivec;
3456  } else
3457 #endif
3458  if (srcfmt->Amask && dstfmt->Amask) {
3459  return BlitNtoNKeyCopyAlpha;
3460  } else {
3461  return BlitNtoNKey;
3462  }
3463  }
3464  }
3465 
3466  return NULL;
3467 }
#define SDL_COPY_RLE_MASK
Definition: SDL_blit.h:45
#define SDL_COPY_COLORKEY
Definition: SDL_blit.h:40
void(* SDL_BlitFunc)(SDL_BlitInfo *info)
Definition: SDL_blit.h:74
static void BlitNtoN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2329
static void BlitNto1Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2506
static void Blit2to2Key(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2572
static void BlitNto1(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2077
static void Blit4to4CopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2222
blit_features
Definition: SDL_blit_N.c:42
#define MASKOK(x, y)
Definition: SDL_blit_N.c:3356
#define NO_ALPHA
Definition: SDL_blit_N.c:3223
#define GetBlitFeatures()
Definition: SDL_blit_N.c:937
static void Blit4to4MaskAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2172
static void Blit_RGB888_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:988
static void Blit_RGB101010_index8(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1098
static const struct blit_table *const normal_blit[]
Definition: SDL_blit_N.c:3351
static void BlitNtoNKey(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2606
#define COPY_ALPHA
Definition: SDL_blit_N.c:3225
static void BlitNtoNCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2448
#define SET_ALPHA
Definition: SDL_blit_N.c:3224
static void BlitNto2101010(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:3014
static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2878
static void Blit2101010toN(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2982
#define SDL_HasAltiVec
GLenum GLsizei GLenum GLenum const void * table
EGLSurface surface
Definition: eglext.h:248
Uint8 BitsPerPixel
Definition: SDL_pixels.h:328
SDL_BlitFunc blitfunc
Definition: SDL_blit_N.c:3232

References SDL_PixelFormat::Amask, SDL_PixelFormat::BitsPerPixel, Blit2101010toN(), Blit2to2Key(), Blit4to4CopyAlpha(), Blit4to4MaskAlpha(), 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:
= {
}
static const struct blit_table normal_blit_3[]
Definition: SDL_blit_N.c:3267
static const struct blit_table normal_blit_1[]
Definition: SDL_blit_N.c:3235
static const struct blit_table normal_blit_2[]
Definition: SDL_blit_N.c:3240
static const struct blit_table normal_blit_4[]
Definition: SDL_blit_N.c:3303

Definition at line 3351 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 3120 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,
{0x0000F800, 0x000007E0, 0x0000001F, 4, 0x000000FF, 0x0000FF00, 0x00FF0000,
{0x0000F800, 0x000007E0, 0x0000001F, 4, 0xFF000000, 0x00FF0000, 0x0000FF00,
{0x0000F800, 0x000007E0, 0x0000001F, 4, 0x0000FF00, 0x00FF0000, 0xFF000000,
{0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
}
static void Blit_RGB565_ABGR8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1793
static void Blit_RGB565_BGRA8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:2069
static void Blit_RGB565_RGBA8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1931
static void Blit_RGB565_ARGB8888(SDL_BlitInfo *info)
Definition: SDL_blit_N.c:1655

Definition at line 3120 of file SDL_blit_N.c.

◆ normal_blit_3

const struct blit_table normal_blit_3[]
static

Definition at line 3120 of file SDL_blit_N.c.

◆ normal_blit_4

const struct blit_table normal_blit_4[]
static

Definition at line 3120 of file SDL_blit_N.c.

◆ RGB565_ABGR8888_LUT

const Uint32 RGB565_ABGR8888_LUT[512]
static

Definition at line 1661 of file SDL_blit_N.c.

Referenced by Blit_RGB565_ABGR8888().

◆ RGB565_ARGB8888_LUT

const Uint32 RGB565_ARGB8888_LUT[512]
static

Definition at line 1523 of file SDL_blit_N.c.

Referenced by Blit_RGB565_ARGB8888().

◆ RGB565_BGRA8888_LUT

const Uint32 RGB565_BGRA8888_LUT[512]
static

Definition at line 1937 of file SDL_blit_N.c.

Referenced by Blit_RGB565_BGRA8888().

◆ RGB565_RGBA8888_LUT

const Uint32 RGB565_RGBA8888_LUT[512]
static

Definition at line 1799 of file SDL_blit_N.c.

Referenced by Blit_RGB565_RGBA8888().