SDL  2.0
SDL_rotate.c File Reference
#include "../../SDL_internal.h"
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
#include "SDL_rotate.h"
+ Include dependency graph for SDL_rotate.c:

Go to the source code of this file.

Data Structures

struct  tColorRGBA
 
struct  tColorY
 

Macros

#define MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define GUARD_ROWS   (2)
 
#define TRANSFORM_SURFACE_90(pixelType)
 

Functions

static Uint32 _colorkey (SDL_Surface *src)
 
void SDLgfx_rotozoomSurfaceSizeTrig (int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle)
 
static void computeSourceIncrements90 (SDL_Surface *src, int bpp, int angle, int flipx, int flipy, int *sincx, int *sincy, int *signx, int *signy)
 
static void transformSurfaceRGBA90 (SDL_Surface *src, SDL_Surface *dst, int angle, int flipx, int flipy)
 
static void transformSurfaceY90 (SDL_Surface *src, SDL_Surface *dst, int angle, int flipx, int flipy)
 
static void _transformSurfaceRGBA (SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth)
 
static void transformSurfaceY (SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy)
 
SDL_SurfaceSDLgfx_rotateSurface (SDL_Surface *src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle)
 

Macro Definition Documentation

◆ GUARD_ROWS

#define GUARD_ROWS   (2)

Definition at line 80 of file SDL_rotate.c.

◆ MAX

#define MAX (   a,
  b 
)    (((a) > (b)) ? (a) : (b))

Definition at line 68 of file SDL_rotate.c.

◆ TRANSFORM_SURFACE_90

#define TRANSFORM_SURFACE_90 (   pixelType)
Value:
int dy, dincy = dst->pitch - dst->w*sizeof(pixelType), sincx, sincy, signx, signy; \
Uint8 *sp = (Uint8*)src->pixels, *dp = (Uint8*)dst->pixels, *de; \
computeSourceIncrements90(src, sizeof(pixelType), angle, flipx, flipy, &sincx, &sincy, &signx, &signy); \
if (signx < 0) sp += (src->w-1)*sizeof(pixelType); \
if (signy < 0) sp += (src->h-1)*src->pitch; \
\
for (dy = 0; dy < dst->h; sp += sincy, dp += dincy, dy++) { \
if (sincx == sizeof(pixelType)) { /* if advancing src and dest equally, use memcpy */ \
SDL_memcpy(dp, sp, dst->w*sizeof(pixelType)); \
sp += dst->w*sizeof(pixelType); \
dp += dst->w*sizeof(pixelType); \
} else { \
for (de = dp + dst->w*sizeof(pixelType); dp != de; sp += sincx, dp += sizeof(pixelType)) { \
*(pixelType*)dp = *(pixelType*)sp; \
} \
} \
}

Definition at line 179 of file SDL_rotate.c.

Function Documentation

◆ _colorkey()

static Uint32 _colorkey ( SDL_Surface src)
static

Definition at line 85 of file SDL_rotate.c.

86 {
87  Uint32 key = 0;
88  if (SDL_HasColorKey(src)) {
90  }
91  return key;
92 }

References SDL_GetColorKey, and SDL_HasColorKey.

Referenced by transformSurfaceY().

◆ _transformSurfaceRGBA()

static void _transformSurfaceRGBA ( SDL_Surface src,
SDL_Surface dst,
int  cx,
int  cy,
int  isin,
int  icos,
int  flipx,
int  flipy,
int  smooth 
)
static

Definition at line 232 of file SDL_rotate.c.

233 {
234  int x, y, t1, t2, dx, dy, xd, yd, sdx, sdy, ax, ay, ex, ey, sw, sh;
235  tColorRGBA c00, c01, c10, c11, cswap;
236  tColorRGBA *pc, *sp;
237  int gap;
238 
239  /*
240  * Variable setup
241  */
242  xd = ((src->w - dst->w) << 15);
243  yd = ((src->h - dst->h) << 15);
244  ax = (cx << 16) - (icos * cx);
245  ay = (cy << 16) - (isin * cx);
246  sw = src->w - 1;
247  sh = src->h - 1;
248  pc = (tColorRGBA*) dst->pixels;
249  gap = dst->pitch - dst->w * 4;
250 
251  /*
252  * Switch between interpolating and non-interpolating code
253  */
254  if (smooth) {
255  for (y = 0; y < dst->h; y++) {
256  dy = cy - y;
257  sdx = (ax + (isin * dy)) + xd;
258  sdy = (ay - (icos * dy)) + yd;
259  for (x = 0; x < dst->w; x++) {
260  dx = (sdx >> 16);
261  dy = (sdy >> 16);
262  if (flipx) dx = sw - dx;
263  if (flipy) dy = sh - dy;
264  if ((dx > -1) && (dy > -1) && (dx < (src->w-1)) && (dy < (src->h-1))) {
265  sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy) + dx;
266  c00 = *sp;
267  sp += 1;
268  c01 = *sp;
269  sp += (src->pitch/4);
270  c11 = *sp;
271  sp -= 1;
272  c10 = *sp;
273  if (flipx) {
274  cswap = c00; c00=c01; c01=cswap;
275  cswap = c10; c10=c11; c11=cswap;
276  }
277  if (flipy) {
278  cswap = c00; c00=c10; c10=cswap;
279  cswap = c01; c01=c11; c11=cswap;
280  }
281  /*
282  * Interpolate colors
283  */
284  ex = (sdx & 0xffff);
285  ey = (sdy & 0xffff);
286  t1 = ((((c01.r - c00.r) * ex) >> 16) + c00.r) & 0xff;
287  t2 = ((((c11.r - c10.r) * ex) >> 16) + c10.r) & 0xff;
288  pc->r = (((t2 - t1) * ey) >> 16) + t1;
289  t1 = ((((c01.g - c00.g) * ex) >> 16) + c00.g) & 0xff;
290  t2 = ((((c11.g - c10.g) * ex) >> 16) + c10.g) & 0xff;
291  pc->g = (((t2 - t1) * ey) >> 16) + t1;
292  t1 = ((((c01.b - c00.b) * ex) >> 16) + c00.b) & 0xff;
293  t2 = ((((c11.b - c10.b) * ex) >> 16) + c10.b) & 0xff;
294  pc->b = (((t2 - t1) * ey) >> 16) + t1;
295  t1 = ((((c01.a - c00.a) * ex) >> 16) + c00.a) & 0xff;
296  t2 = ((((c11.a - c10.a) * ex) >> 16) + c10.a) & 0xff;
297  pc->a = (((t2 - t1) * ey) >> 16) + t1;
298  }
299  sdx += icos;
300  sdy += isin;
301  pc++;
302  }
303  pc = (tColorRGBA *) ((Uint8 *) pc + gap);
304  }
305  } else {
306  for (y = 0; y < dst->h; y++) {
307  dy = cy - y;
308  sdx = (ax + (isin * dy)) + xd;
309  sdy = (ay - (icos * dy)) + yd;
310  for (x = 0; x < dst->w; x++) {
311  dx = (sdx >> 16);
312  dy = (sdy >> 16);
313  if ((unsigned)dx < (unsigned)src->w && (unsigned)dy < (unsigned)src->h) {
314  if(flipx) dx = sw - dx;
315  if(flipy) dy = sh - dy;
316  *pc = *((tColorRGBA *)((Uint8 *)src->pixels + src->pitch * dy) + dx);
317  }
318  sdx += icos;
319  sdy += isin;
320  pc++;
321  }
322  pc = (tColorRGBA *) ((Uint8 *) pc + gap);
323  }
324  }
325 }

References tColorRGBA::a, tColorRGBA::b, tColorRGBA::g, if, and tColorRGBA::r.

Referenced by SDLgfx_rotateSurface().

◆ computeSourceIncrements90()

static void computeSourceIncrements90 ( SDL_Surface src,
int  bpp,
int  angle,
int  flipx,
int  flipy,
int *  sincx,
int *  sincy,
int *  signx,
int *  signy 
)
static

Definition at line 156 of file SDL_rotate.c.

158 {
159  int pitch = flipy ? -src->pitch : src->pitch;
160  if (flipx) {
161  bpp = -bpp;
162  }
163  switch (angle) { /* 0:0 deg, 1:90 deg, 2:180 deg, 3:270 deg */
164  case 0: *sincx = bpp; *sincy = pitch - src->w * *sincx; *signx = *signy = 1; break;
165  case 1: *sincx = -pitch; *sincy = bpp - *sincx * src->h; *signx = 1; *signy = -1; break;
166  case 2: *sincx = -bpp; *sincy = -src->w * *sincx - pitch; *signx = *signy = -1; break;
167  case 3: default: *sincx = pitch; *sincy = -*sincx * src->h - bpp; *signx = -1; *signy = 1; break;
168  }
169  if (flipx) {
170  *signx = -*signx;
171  }
172  if (flipy) {
173  *signy = -*signy;
174  }
175 }

References bpp.

◆ SDLgfx_rotateSurface()

SDL_Surface* SDLgfx_rotateSurface ( SDL_Surface src,
double  angle,
int  centerx,
int  centery,
int  smooth,
int  flipx,
int  flipy,
int  dstwidth,
int  dstheight,
double  cangle,
double  sangle 
)

Definition at line 417 of file SDL_rotate.c.

418 {
419  SDL_Surface *rz_dst;
420  int is8bit, angle90;
421  int i;
422  SDL_BlendMode blendmode;
423  Uint32 colorkey = 0;
424  int colorKeyAvailable = SDL_FALSE;
425  double sangleinv, cangleinv;
426 
427  /* Sanity check */
428  if (src == NULL)
429  return NULL;
430 
431  if (SDL_HasColorKey(src)) {
432  if (SDL_GetColorKey(src, &colorkey) == 0) {
433  colorKeyAvailable = SDL_TRUE;
434  }
435  }
436 
437  /* This function requires a 32-bit surface or 8-bit surface with a colorkey */
438  is8bit = src->format->BitsPerPixel == 8 && colorKeyAvailable;
439  if (!(is8bit || (src->format->BitsPerPixel == 32 && src->format->Amask)))
440  return NULL;
441 
442  /* Calculate target factors from sin/cos and zoom */
443  sangleinv = sangle*65536.0;
444  cangleinv = cangle*65536.0;
445 
446  /* Alloc space to completely contain the rotated surface */
447  rz_dst = NULL;
448  if (is8bit) {
449  /* Target surface is 8 bit */
450  rz_dst = SDL_CreateRGBSurface(0, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0);
451  if (rz_dst != NULL) {
452  for (i = 0; i < src->format->palette->ncolors; i++) {
453  rz_dst->format->palette->colors[i] = src->format->palette->colors[i];
454  }
455  rz_dst->format->palette->ncolors = src->format->palette->ncolors;
456  }
457  } else {
458  /* Target surface is 32 bit with source RGBA ordering */
459  rz_dst = SDL_CreateRGBSurface(0, dstwidth, dstheight + GUARD_ROWS, 32,
460  src->format->Rmask, src->format->Gmask,
461  src->format->Bmask, src->format->Amask);
462  }
463 
464  /* Check target */
465  if (rz_dst == NULL)
466  return NULL;
467 
468  /* Adjust for guard rows */
469  rz_dst->h = dstheight;
470 
471  SDL_GetSurfaceBlendMode(src, &blendmode);
472 
473  if (colorKeyAvailable == SDL_TRUE) {
474  /* If available, the colorkey will be used to discard the pixels that are outside of the rotated area. */
475  SDL_SetColorKey(rz_dst, SDL_TRUE, colorkey);
476  SDL_FillRect(rz_dst, NULL, colorkey);
477  } else if (blendmode == SDL_BLENDMODE_NONE) {
478  blendmode = SDL_BLENDMODE_BLEND;
479  } else if (blendmode == SDL_BLENDMODE_MOD || blendmode == SDL_BLENDMODE_MUL) {
480  /* Without a colorkey, the target texture has to be white for the MOD and MUL blend mode so
481  * that the pixels outside the rotated area don't affect the destination surface.
482  */
483  colorkey = SDL_MapRGBA(rz_dst->format, 255, 255, 255, 0);
484  SDL_FillRect(rz_dst, NULL, colorkey);
485  /* Setting a white colorkey for the destination surface makes the final blit discard
486  * all pixels outside of the rotated area. This doesn't interfere with anything because
487  * white pixels are already a no-op and the MOD blend mode does not interact with alpha.
488  */
489  SDL_SetColorKey(rz_dst, SDL_TRUE, colorkey);
490  }
491 
492  SDL_SetSurfaceBlendMode(rz_dst, blendmode);
493 
494  /* Lock source surface */
495  if (SDL_MUSTLOCK(src)) {
497  }
498 
499  /* check if the rotation is a multiple of 90 degrees so we can take a fast path and also somewhat reduce
500  * the off-by-one problem in _transformSurfaceRGBA that expresses itself when the rotation is near
501  * multiples of 90 degrees.
502  */
503  angle90 = (int)(angle/90);
504  if (angle90 == angle/90) {
505  angle90 %= 4;
506  if (angle90 < 0) angle90 += 4; /* 0:0 deg, 1:90 deg, 2:180 deg, 3:270 deg */
507  } else {
508  angle90 = -1;
509  }
510 
511  if (is8bit) {
512  /* Call the 8-bit transformation routine to do the rotation */
513  if(angle90 >= 0) {
514  transformSurfaceY90(src, rz_dst, angle90, flipx, flipy);
515  } else {
516  transformSurfaceY(src, rz_dst, centerx, centery, (int)sangleinv, (int)cangleinv,
517  flipx, flipy);
518  }
519  } else {
520  /* Call the 32-bit transformation routine to do the rotation */
521  if (angle90 >= 0) {
522  transformSurfaceRGBA90(src, rz_dst, angle90, flipx, flipy);
523  } else {
524  _transformSurfaceRGBA(src, rz_dst, centerx, centery, (int)sangleinv, (int)cangleinv,
525  flipx, flipy, smooth);
526  }
527  }
528 
529  /* Unlock source surface */
530  if (SDL_MUSTLOCK(src)) {
532  }
533 
534  /* Return rotated surface */
535  return rz_dst;
536 }

References _transformSurfaceRGBA(), SDL_Palette::colors, SDL_Surface::format, GUARD_ROWS, SDL_Surface::h, i, SDL_Palette::ncolors, NULL, SDL_PixelFormat::palette, SDL_BLENDMODE_BLEND, SDL_BLENDMODE_MOD, SDL_BLENDMODE_MUL, SDL_BLENDMODE_NONE, SDL_CreateRGBSurface, SDL_FALSE, SDL_FillRect, SDL_GetColorKey, SDL_GetSurfaceBlendMode, SDL_HasColorKey, SDL_LockSurface, SDL_MapRGBA, SDL_MUSTLOCK, SDL_SetColorKey, SDL_SetSurfaceBlendMode, SDL_TRUE, SDL_UnlockSurface, transformSurfaceRGBA90(), transformSurfaceY(), and transformSurfaceY90().

Referenced by SW_RenderCopyEx().

◆ SDLgfx_rotozoomSurfaceSizeTrig()

void SDLgfx_rotozoomSurfaceSizeTrig ( int  width,
int  height,
double  angle,
int *  dstwidth,
int *  dstheight,
double *  cangle,
double *  sangle 
)

Definition at line 108 of file SDL_rotate.c.

111 {
112  /* The trig code below gets the wrong size (due to FP inaccuracy?) when angle is a multiple of 90 degrees */
113  int angle90 = (int)(angle/90);
114  if(angle90 == angle/90) { /* if the angle is a multiple of 90 degrees */
115  angle90 %= 4;
116  if(angle90 < 0) angle90 += 4; /* 0:0 deg, 1:90 deg, 2:180 deg, 3:270 deg */
117  if(angle90 & 1) {
118  *dstwidth = height;
119  *dstheight = width;
120  *cangle = 0;
121  *sangle = angle90 == 1 ? -1 : 1; /* reversed because our rotations are clockwise */
122  } else {
123  *dstwidth = width;
124  *dstheight = height;
125  *cangle = angle90 == 0 ? 1 : -1;
126  *sangle = 0;
127  }
128  } else {
129  double x, y, cx, cy, sx, sy;
130  double radangle;
131  int dstwidthhalf, dstheighthalf;
132  /*
133  * Determine destination width and height by rotating a centered source box
134  */
135  radangle = angle * (M_PI / -180.0); /* reverse the angle because our rotations are clockwise */
136  *sangle = SDL_sin(radangle);
137  *cangle = SDL_cos(radangle);
138  x = (double)(width / 2);
139  y = (double)(height / 2);
140  cx = *cangle * x;
141  cy = *cangle * y;
142  sx = *sangle * x;
143  sy = *sangle * y;
144 
145  dstwidthhalf = MAX((int)
146  SDL_ceil(MAX(MAX(MAX(SDL_fabs(cx + sy), SDL_fabs(cx - sy)), SDL_fabs(-cx + sy)), SDL_fabs(-cx - sy))), 1);
147  dstheighthalf = MAX((int)
148  SDL_ceil(MAX(MAX(MAX(SDL_fabs(sx + cy), SDL_fabs(sx - cy)), SDL_fabs(-sx + cy)), SDL_fabs(-sx - cy))), 1);
149  *dstwidth = 2 * dstwidthhalf;
150  *dstheight = 2 * dstheighthalf;
151  }
152 }

References MAX, SDL_ceil, SDL_cos, SDL_fabs, and SDL_sin.

Referenced by SW_RenderCopyEx().

◆ transformSurfaceRGBA90()

static void transformSurfaceRGBA90 ( SDL_Surface src,
SDL_Surface dst,
int  angle,
int  flipx,
int  flipy 
)
static

Definition at line 199 of file SDL_rotate.c.

200 {
202 }

References TRANSFORM_SURFACE_90.

Referenced by SDLgfx_rotateSurface().

◆ transformSurfaceY()

static void transformSurfaceY ( SDL_Surface src,
SDL_Surface dst,
int  cx,
int  cy,
int  isin,
int  icos,
int  flipx,
int  flipy 
)
static

Definition at line 346 of file SDL_rotate.c.

347 {
348  int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay;
349  tColorY *pc;
350  int gap;
351 
352  /*
353  * Variable setup
354  */
355  xd = ((src->w - dst->w) << 15);
356  yd = ((src->h - dst->h) << 15);
357  ax = (cx << 16) - (icos * cx);
358  ay = (cy << 16) - (isin * cx);
359  pc = (tColorY*) dst->pixels;
360  gap = dst->pitch - dst->w;
361  /*
362  * Clear surface to colorkey
363  */
364  SDL_memset(pc, (int)(_colorkey(src) & 0xff), dst->pitch * dst->h);
365  /*
366  * Iterate through destination surface
367  */
368  for (y = 0; y < dst->h; y++) {
369  dy = cy - y;
370  sdx = (ax + (isin * dy)) + xd;
371  sdy = (ay - (icos * dy)) + yd;
372  for (x = 0; x < dst->w; x++) {
373  dx = (sdx >> 16);
374  dy = (sdy >> 16);
375  if ((unsigned)dx < (unsigned)src->w && (unsigned)dy < (unsigned)src->h) {
376  if (flipx) dx = (src->w-1)-dx;
377  if (flipy) dy = (src->h-1)-dy;
378  *pc = *((tColorY *)src->pixels + src->pitch * dy + dx);
379  }
380  sdx += icos;
381  sdy += isin;
382  pc++;
383  }
384  pc += gap;
385  }
386 }

References _colorkey(), and SDL_memset.

Referenced by SDLgfx_rotateSurface().

◆ transformSurfaceY90()

static void transformSurfaceY90 ( SDL_Surface src,
SDL_Surface dst,
int  angle,
int  flipx,
int  flipy 
)
static

Definition at line 205 of file SDL_rotate.c.

206 {
208 }

References TRANSFORM_SURFACE_90.

Referenced by SDLgfx_rotateSurface().

SDL_UnlockSurface
#define SDL_UnlockSurface
Definition: SDL_dynapi_overrides.h:449
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179
SDL_memset
#define SDL_memset
Definition: SDL_dynapi_overrides.h:386
tColorRGBA::r
Uint8 r
Definition: SDL_rotate.c:51
t1
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition: SDL_opengl_glext.h:8586
SDL_Palette::ncolors
int ncolors
Definition: SDL_pixels.h:309
SDL_MapRGBA
#define SDL_MapRGBA
Definition: SDL_dynapi_overrides.h:287
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:71
if
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
Definition: pixman-arm-neon-asm.h:469
SDL_fabs
#define SDL_fabs
Definition: SDL_dynapi_overrides.h:430
SDL_ceil
#define SDL_ceil
Definition: SDL_dynapi_overrides.h:426
NULL
#define NULL
Definition: begin_code.h:167
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
tColorRGBA::a
Uint8 a
Definition: SDL_rotate.c:54
SDL_BLENDMODE_BLEND
@ SDL_BLENDMODE_BLEND
Definition: SDL_blendmode.h:44
MAX
#define MAX(a, b)
Definition: SDL_rotate.c:67
transformSurfaceRGBA90
static void transformSurfaceRGBA90(SDL_Surface *src, SDL_Surface *dst, int angle, int flipx, int flipy)
Definition: SDL_rotate.c:199
computeSourceIncrements90
static void computeSourceIncrements90(SDL_Surface *src, int bpp, int angle, int flipx, int flipy, int *sincx, int *sincy, int *signx, int *signy)
Definition: SDL_rotate.c:156
tColorRGBA::b
Uint8 b
Definition: SDL_rotate.c:53
SDL_MUSTLOCK
#define SDL_MUSTLOCK(S)
Definition: SDL_surface.h:62
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1949
SDL_GetSurfaceBlendMode
#define SDL_GetSurfaceBlendMode
Definition: SDL_dynapi_overrides.h:460
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1740
GUARD_ROWS
#define GUARD_ROWS
Definition: SDL_rotate.c:79
SDL_Palette::colors
SDL_Color * colors
Definition: SDL_pixels.h:310
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
SDL_BLENDMODE_NONE
@ SDL_BLENDMODE_NONE
Definition: SDL_blendmode.h:42
height
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
SDL_cos
#define SDL_cos
Definition: SDL_dynapi_overrides.h:428
_transformSurfaceRGBA
static void _transformSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth)
Definition: SDL_rotate.c:232
SDL_PixelFormat::palette
SDL_Palette * palette
Definition: SDL_pixels.h:321
SDL_SetColorKey
#define SDL_SetColorKey
Definition: SDL_dynapi_overrides.h:453
SDL_GetColorKey
#define SDL_GetColorKey
Definition: SDL_dynapi_overrides.h:454
key
GLuint64 key
Definition: gl2ext.h:2192
SDL_TRUE
@ SDL_TRUE
Definition: SDL_stdinc.h:164
transformSurfaceY
static void transformSurfaceY(SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy)
Definition: SDL_rotate.c:346
_colorkey
static Uint32 _colorkey(SDL_Surface *src)
Definition: SDL_rotate.c:85
SDL_BLENDMODE_MUL
@ SDL_BLENDMODE_MUL
Definition: SDL_blendmode.h:53
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
bpp
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
Definition: pixman-arm-neon-asm.h:146
SDL_LockSurface
#define SDL_LockSurface
Definition: SDL_dynapi_overrides.h:448
SDL_CreateRGBSurface
#define SDL_CreateRGBSurface
Definition: SDL_dynapi_overrides.h:444
SDL_Surface::h
int h
Definition: SDL_surface.h:74
transformSurfaceY90
static void transformSurfaceY90(SDL_Surface *src, SDL_Surface *dst, int angle, int flipx, int flipy)
Definition: SDL_rotate.c:205
src
GLenum src
Definition: SDL_opengl_glext.h:1740
TRANSFORM_SURFACE_90
#define TRANSFORM_SURFACE_90(pixelType)
Definition: SDL_rotate.c:178
tColorRGBA
Definition: SDL_rotate.c:50
SDL_SetSurfaceBlendMode
#define SDL_SetSurfaceBlendMode
Definition: SDL_dynapi_overrides.h:459
tColorRGBA::g
Uint8 g
Definition: SDL_rotate.c:52
angle
GLfloat angle
Definition: SDL_opengl_glext.h:6100
SDL_FillRect
#define SDL_FillRect
Definition: SDL_dynapi_overrides.h:466
tColorY
Definition: SDL_rotate.c:60
SDL_FALSE
@ SDL_FALSE
Definition: SDL_stdinc.h:163
SDL_sin
#define SDL_sin
Definition: SDL_dynapi_overrides.h:435
SDL_Surface::format
SDL_PixelFormat * format
Definition: SDL_surface.h:73
SDL_BLENDMODE_MOD
@ SDL_BLENDMODE_MOD
Definition: SDL_blendmode.h:50
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
SDL_HasColorKey
#define SDL_HasColorKey
Definition: SDL_dynapi_overrides.h:699
SDL_BlendMode
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
Definition: SDL_blendmode.h:41
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:734