Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

SDL_rotozoom.h

00001 /* 00002 * SDL_rotozoom - rotozoomer 00003 * 00004 * LGPL (c) A. Schiffler 00005 * 00006 */ 00007 00008 #ifndef DEF_SDL_ROTOZOOM_H 00009 #define DEF_SDL_ROTOZOOM_H 00010 00011 #ifndef M_PI 00012 #define M_PI 3.141592654 00013 #endif 00014 00015 #define SMOOTHING_OFF 0 00016 #define SMOOTHING_ON 1 00017 00018 typedef struct tColorRGBA { 00019 Uint8 r; 00020 Uint8 g; 00021 Uint8 b; 00022 Uint8 a; 00023 } tColorRGBA; 00024 00025 typedef struct tColorY { 00026 Uint8 y; 00027 } tColorY; 00028 00029 00030 /* 00031 * rotozoomSurface() 00032 * 00033 * Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. 00034 * 'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1 00035 * then the destination 32bit surface is anti-aliased. If the surface is not 8bit 00036 * or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. 00037 */ 00038 00039 SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth); 00040 SDL_Surface *rotozoomSurfaceXY (SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth); 00041 00042 /* Returns the size of the target surface for a rotozoomSurface() call */ 00043 00044 void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight); 00045 void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight); 00046 00047 /* 00048 * zoomSurface() 00049 * 00050 * Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface. 00051 * 'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1 00052 * then the destination 32bit surface is anti-aliased. If the surface is not 8bit 00053 * or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. 00054 */ 00055 00056 SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth); 00057 00058 /* Returns the size of the target surface for a zoomSurface() call */ 00059 00060 void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight); 00061 00062 #endif

Generated on Sun Feb 5 13:02:35 2006 for Lost Penguins by doxygen 1.3.8