4 SDL_rotozoom - rotozoomer
10 #ifndef _SDL_rotozoom_h
11 #define _SDL_rotozoom_h
15 /* Set up for C function definitions, even when using C++ */
21 #define M_PI 3.141592654
28 #define SMOOTHING_OFF 0
29 #define SMOOTHING_ON 1
33 typedef struct tColorRGBA
{
40 typedef struct tColorY
{
49 #define DLLINTERFACE __declspec(dllexport)
51 #define DLLINTERFACE __declspec(dllimport)
61 Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
62 'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1
63 then the destination 32bit surface is anti-aliased. If the surface is not 8bit
64 or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
68 DLLINTERFACE SDL_Surface
*rotozoomSurface(SDL_Surface
* src
, double angle
, double zoom
, int smooth
);
70 DLLINTERFACE SDL_Surface
*rotozoomSurfaceXY
71 (SDL_Surface
* src
, double angle
, double zoomx
, double zoomy
, int smooth
);
73 /* Returns the size of the target surface for a rotozoomSurface() call */
75 DLLINTERFACE
void rotozoomSurfaceSize(int width
, int height
, double angle
, double zoom
, int *dstwidth
,
78 DLLINTERFACE
void rotozoomSurfaceSizeXY
79 (int width
, int height
, double angle
, double zoomx
, double zoomy
,
80 int *dstwidth
, int *dstheight
);
86 Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
87 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1
88 then the destination 32bit surface is anti-aliased. If the surface is not 8bit
89 or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
93 DLLINTERFACE SDL_Surface
*zoomSurface(SDL_Surface
* src
, double zoomx
, double zoomy
, int smooth
);
95 /* Returns the size of the target surface for a zoomSurface() call */
97 DLLINTERFACE
void zoomSurfaceSize(int width
, int height
, double zoomx
, double zoomy
, int *dstwidth
, int *dstheight
);
103 Shrinks a 32bit or 8bit 'src' surface ti a newly created 'dst' surface.
104 'factorx' and 'factory' are the shrinking ratios (i.e. 2=1/2 the size,
105 3=1/3 the size, etc.) The destination surface is antialiased by averaging
106 the source box RGBA or Y information. If the surface is not 8bit
107 or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
110 DLLINTERFACE SDL_Surface
*shrinkSurface(SDL_Surface
* src
, int factorx
, int factory
);
118 DLLINTERFACE SDL_Surface
* rotateSurface90Degrees(SDL_Surface
* pSurf
, int numClockwiseTurns
);
120 /* Ends C function definitions when using C++ */
125 #endif /* _SDL_rotozoom_h */