3
SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces
5
Copyright (C) 2001-2012 Andreas Schiffler
7
This software is provided 'as-is', without any express or implied
8
warranty. In no event will the authors be held liable for any damages
9
arising from the use of this software.
11
Permission is granted to anyone to use this software for any purpose,
12
including commercial applications, and to alter it and redistribute it
13
freely, subject to the following restrictions:
15
1. The origin of this software must not be misrepresented; you must not
16
claim that you wrote the original software. If you use this software
17
in a product, an acknowledgment in the product documentation would be
18
appreciated but is not required.
20
2. Altered source versions must be plainly marked as such, and must not be
21
misrepresented as being the original software.
23
3. This notice may not be removed or altered from any source
26
Andreas Schiffler -- aschiffler at ferzkopp dot net
30
#ifndef _SDL2_rotozoom_h
31
#define _SDL2_rotozoom_h
35
/* Set up for C function definitions, even when using C++ */
41
#define M_PI 3.1415926535897932384626433832795
49
\brief Disable anti-aliasing (no smoothing).
51
#define SMOOTHING_OFF 0
54
\brief Enable anti-aliasing (smoothing).
56
#define SMOOTHING_ON 1
58
/* ---- Function Prototypes */
61
# if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT)
62
# define SDL2_ROTOZOOM_SCOPE __declspec(dllexport)
64
# ifdef LIBSDL2_GFX_DLL_IMPORT
65
# define SDL2_ROTOZOOM_SCOPE __declspec(dllimport)
69
#ifndef SDL2_ROTOZOOM_SCOPE
70
# define SDL2_ROTOZOOM_SCOPE extern
79
SDL2_ROTOZOOM_SCOPE SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth);
81
SDL2_ROTOZOOM_SCOPE SDL_Surface *rotozoomSurfaceXY
82
(SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth);
85
SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth,
88
SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSizeXY
89
(int width, int height, double angle, double zoomx, double zoomy,
90
int *dstwidth, int *dstheight);
98
SDL2_ROTOZOOM_SCOPE SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth);
100
SDL2_ROTOZOOM_SCOPE void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight);
108
SDL2_ROTOZOOM_SCOPE SDL_Surface *shrinkSurface(SDL_Surface * src, int factorx, int factory);
112
Specialized rotation functions
116
SDL2_ROTOZOOM_SCOPE SDL_Surface* rotateSurface90Degrees(SDL_Surface* src, int numClockwiseTurns);
118
/* Ends C function definitions when using C++ */
123
#endif /* _SDL2_rotozoom_h */