Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

SDL_rotozoom.h

Go to the documentation of this file.
00001 
00002 /*
00003 
00004  SDL_rotozoom - rotozoomer
00005 
00006  LGPL (c) A. Schiffler
00007 
00008 */
00009 
00010 #ifndef _SDL_rotozoom_h
00011 #define _SDL_rotozoom_h
00012 
00013 /* Set up for C function definitions, even when using C++ */
00014 #include <math.h>
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018 
00019 #ifndef M_PI
00020 #define M_PI    3.141592654
00021 #endif
00022 #include "SDL.h"
00023 
00024 
00025 /* ---- Defines */
00026 
00027 #define SMOOTHING_OFF       0
00028 #define SMOOTHING_ON        1
00029 
00030 /* ---- Structures */
00031 
00032     typedef struct tColorRGBA {
00033     Uint8 r;
00034     Uint8 g;
00035     Uint8 b;
00036     Uint8 a;
00037     } tColorRGBA;
00038 
00039     typedef struct tColorY {
00040     Uint8 y;
00041     } tColorY;
00042 
00043 
00044 /* ---- Prototypes */
00045 
00046 #define DLLINTERFACE
00047 
00048 /* 
00049  
00050  rotozoomSurface()
00051 
00052  Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
00053  'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1
00054  then the destination 32bit surface is anti-aliased. If the surface is not 8bit
00055  or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
00056 
00057 */
00058 
00059     DLLINTERFACE SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth);
00060 
00061 
00062 /* Returns the size of the target surface for a rotozoomSurface() call */
00063 
00064     DLLINTERFACE void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth,
00065                       int *dstheight);
00066 
00067 /* 
00068  
00069  zoomSurface()
00070 
00071  Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
00072  'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1
00073  then the destination 32bit surface is anti-aliased. If the surface is not 8bit
00074  or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
00075 
00076 */
00077 
00078     DLLINTERFACE SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth);
00079 
00080 /* Returns the size of the target surface for a zoomSurface() call */
00081 
00082     DLLINTERFACE void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight);
00083 
00084 
00085 /* Ends C function definitions when using C++ */
00086 #ifdef __cplusplus
00087 };
00088 #endif
00089 
00090 #endif              /* _SDL_rotozoom_h */

Generated on Wed Jul 14 00:43:43 2004 for CSLib by doxygen 1.3.6