ManaPlus
|
Go to the source code of this file.
Macros | |
#define | SMOOTHING_OFF 0 |
Disable anti-aliasing (no smoothing). More... | |
#define | SMOOTHING_ON 1 |
Enable anti-aliasing (smoothing). More... | |
#define | SDL2_ROTOZOOM_SCOPE extern |
Functions | |
SDL_Surface * | rotozoomSurface (SDL_Surface *src, double angle, double zoom, int smooth) |
Rotates and zooms a surface and optional anti-aliasing. More... | |
SDL_Surface * | rotozoomSurfaceXY (SDL_Surface *src, double angle, double zoomx, double zoomy, int smooth) |
Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. More... | |
void | rotozoomSurfaceSize (int width, int height, double angle, double zoom, int *dstwidth, int *dstheight) |
Returns the size of the resulting target surface for a rotozoomSurface() call. More... | |
void | rotozoomSurfaceSizeXY (int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight) |
Returns the size of the resulting target surface for a rotozoomSurfaceXY() call. More... | |
SDL_Surface * | zoomSurface (SDL_Surface *src, double zoomx, double zoomy, int smooth) |
Zoom a surface by independent horizontal and vertical factors with optional smoothing. More... | |
void | zoomSurfaceSize (int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight) |
Calculates the size of the target surface for a zoomSurface() call. More... | |
SDL_Surface * | shrinkSurface (SDL_Surface *src, int factorx, int factory) |
Shrink a surface by an integer ratio using averaging. More... | |
SDL_Surface * | rotateSurface90Degrees (SDL_Surface *src, int numClockwiseTurns) |
Rotates a 8/16/24/32 bit surface in increments of 90 degrees. More... | |
#define SDL2_ROTOZOOM_SCOPE extern |
Definition at line 78 of file SDL2_rotozoom.h.
#define SMOOTHING_OFF 0 |
Disable anti-aliasing (no smoothing).
Definition at line 59 of file SDL2_rotozoom.h.
#define SMOOTHING_ON 1 |
Enable anti-aliasing (smoothing).
Definition at line 64 of file SDL2_rotozoom.h.
SDL_Surface* rotateSurface90Degrees | ( | SDL_Surface * | src, |
int | numClockwiseTurns | ||
) |
Rotates a 8/16/24/32 bit surface in increments of 90 degrees.
Specialized 90 degree rotator which rotates a 'src' surface in 90 degree increments clockwise returning a new surface. Faster than rotozoomer since no scanning or interpolation takes place. Input surface must be 8/16/24/32 bit. (code contributed by J. Schiller, improved by C. Allport and A. Schiffler)
src | Source surface to rotate. |
numClockwiseTurns | Number of clockwise 90 degree turns to apply to the source. |
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
Definition at line 914 of file SDL2_rotozoom.cpp.
SDL_Surface* rotozoomSurface | ( | SDL_Surface * | src, |
double | angle, | ||
double | zoom, | ||
int | smooth | ||
) |
Rotates and zooms a surface and optional anti-aliasing.
Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees and 'zoom' a scaling factor. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
src | The surface to rotozoom. |
angle | The angle to rotate in degrees. |
zoom | The scaling factor. |
smooth | Antialiasing flag; set to SMOOTHING_ON to enable. |
Definition at line 1204 of file SDL2_rotozoom.cpp.
References rotozoomSurfaceXY().
void rotozoomSurfaceSize | ( | int | width, |
int | height, | ||
double | angle, | ||
double | zoom, | ||
int * | dstwidth, | ||
int * | dstheight | ||
) |
Returns the size of the resulting target surface for a rotozoomSurface() call.
width | The source surface width. |
height | The source surface height. |
angle | The angle to rotate in degrees. |
zoom | The scaling factor. |
dstwidth | The calculated width of the rotozoomed destination surface. |
dstheight | The calculated height of the rotozoomed destination surface. |
Definition at line 1175 of file SDL2_rotozoom.cpp.
References _rotozoomSurfaceSizeTrig().
void rotozoomSurfaceSizeXY | ( | int | width, |
int | height, | ||
double | angle, | ||
double | zoomx, | ||
double | zoomy, | ||
int * | dstwidth, | ||
int * | dstheight | ||
) |
Returns the size of the resulting target surface for a rotozoomSurfaceXY() call.
width | The source surface width. |
height | The source surface height. |
angle | The angle to rotate in degrees. |
zoomx | The horizontal scaling factor. |
zoomy | The vertical scaling factor. |
dstwidth | The calculated width of the rotozoomed destination surface. |
dstheight | The calculated height of the rotozoomed destination surface. |
Definition at line 1150 of file SDL2_rotozoom.cpp.
References _rotozoomSurfaceSizeTrig().
SDL_Surface* rotozoomSurfaceXY | ( | SDL_Surface * | src, |
double | angle, | ||
double | zoomx, | ||
double | zoomy, | ||
int | smooth | ||
) |
Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing.
Rotates and zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'angle' is the rotation in degrees, 'zoomx and 'zoomy' scaling factors. If 'smooth' is set then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
src | The surface to rotozoom. |
angle | The angle to rotate in degrees. |
zoomx | The horizontal scaling factor. |
zoomy | The vertical scaling factor. |
smooth | Antialiasing flag; set to SMOOTHING_ON to enable. |
< Surface is in system memory
< Surface is in system memory
< Surface is in system memory
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
< Surface is in system memory
< Surface is in system memory
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
Definition at line 1230 of file SDL2_rotozoom.cpp.
References _rotozoomSurfaceSizeTrig(), _transformSurfaceRGBA(), _zoomSurfaceRGBA(), _zoomSurfaceY(), GUARD_ROWS, transformSurfaceY(), VALUE_LIMIT, and zoomSurfaceSize().
Referenced by rotozoomSurface().
SDL_Surface* shrinkSurface | ( | SDL_Surface * | src, |
int | factorx, | ||
int | factory | ||
) |
Shrink a surface by an integer ratio using averaging.
Shrinks a 32bit or 8bit 'src' surface to a newly created 'dst' surface. 'factorx' and 'factory' are the shrinking ratios (i.e. 2=1/2 the size, 3=1/3 the size, etc.) The destination surface is antialiased by averaging the source box RGBA or Y information. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. The input surface is not modified. The output surface is newly allocated.
src | The surface to shrink. |
factorx | The horizontal shrinking ratio. |
factory | The vertical shrinking ratio. |
< Surface is in system memory
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
< Surface is in system memory
< Surface is in system memory
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
Definition at line 1762 of file SDL2_rotozoom.cpp.
References _shrinkSurfaceRGBA(), _shrinkSurfaceY(), and GUARD_ROWS.
SDL_Surface* zoomSurface | ( | SDL_Surface * | src, |
double | zoomx, | ||
double | zoomy, | ||
int | smooth | ||
) |
Zoom a surface by independent horizontal and vertical factors with optional smoothing.
Zooms a 32bit or 8bit 'src' surface to newly created 'dst' surface. 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is on then the destination 32bit surface is anti-aliased. If the surface is not 8bit or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. If zoom factors are negative, the image is flipped on the axes.
src | The surface to zoom. |
zoomx | The horizontal zoom factor. |
zoomy | The vertical zoom factor. |
smooth | Antialiasing flag; set to SMOOTHING_ON to enable. |
< Surface is in system memory
< Surface is in system memory
< Surface is in system memory
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
< Surface is in video memory
< Use asynchronous blits if possible
< Surface is RLE encoded
Definition at line 1590 of file SDL2_rotozoom.cpp.
References _zoomSurfaceRGBA(), _zoomSurfaceY(), GUARD_ROWS, and zoomSurfaceSize().
void zoomSurfaceSize | ( | int | width, |
int | height, | ||
double | zoomx, | ||
double | zoomy, | ||
int * | dstwidth, | ||
int * | dstheight | ||
) |
Calculates the size of the target surface for a zoomSurface() call.
The minimum size of the target surface is 1. The input factors can be positive or negative.
width | The width of the source surface to zoom. |
height | The height of the source surface to zoom. |
zoomx | The horizontal zoom factor. |
zoomy | The vertical zoom factor. |
dstwidth | Pointer to an integer to store the calculated width of the zoomed target surface. |
dstheight | Pointer to an integer to store the calculated height of the zoomed target surface. |
Definition at line 1531 of file SDL2_rotozoom.cpp.
References VALUE_LIMIT.
Referenced by rotozoomSurfaceXY(), and zoomSurface().