home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue6 / SDL.ZIP / !SDL / include / SDL / h / SDL_rotozoom < prev    next >
Encoding:
Text File  |  2006-09-25  |  2.5 KB  |  111 lines

  1.  
  2. /*
  3.  
  4.  SDL_rotozoom - rotozoomer
  5.  
  6.  LGPL (c) A. Schiffler
  7.  
  8. */
  9.  
  10. #ifndef _SDL_rotozoom_h
  11. #define _SDL_rotozoom_h
  12.  
  13. #include <math.h>
  14.  
  15. /* Set up for C function definitions, even when using C++ */
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20. #ifndef M_PI
  21. #define M_PI    3.141592654
  22. #endif
  23.  
  24. #include "SDL.h"
  25.  
  26. /* ---- Defines */
  27.  
  28. #define SMOOTHING_OFF        0
  29. #define SMOOTHING_ON        1
  30.  
  31. /* ---- Structures */
  32.  
  33.     typedef struct tColorRGBA {
  34.     Uint8 r;
  35.     Uint8 g;
  36.     Uint8 b;
  37.     Uint8 a;
  38.     } tColorRGBA;
  39.  
  40. #ifdef __riscos__
  41. /* A.Buckley 23/9/06 - redefined tColorY as definition of it as
  42.    a structure makes it 32 bits long*/
  43.    typedef Uint8 tColorY; 
  44. #else
  45.     typedef struct tColorY {
  46.     Uint8 y;
  47.     } tColorY;
  48. #endif
  49.  
  50. /* ---- Prototypes */
  51.  
  52. #ifdef WIN32
  53. #ifdef BUILD_DLL
  54. #define DLLINTERFACE __declspec(dllexport)
  55. #else
  56. #define DLLINTERFACE __declspec(dllimport)
  57. #endif
  58. #else
  59. #define DLLINTERFACE
  60. #endif
  61.  
  62. /* 
  63.  
  64.  rotozoomSurface()
  65.  
  66.  Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
  67.  'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1
  68.  then the destination 32bit surface is anti-aliased. If the surface is not 8bit
  69.  or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
  70.  
  71. */
  72.  
  73.     DLLINTERFACE SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth);
  74.  
  75.     DLLINTERFACE SDL_Surface *rotozoomSurfaceXY
  76.     (SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth);
  77.  
  78. /* Returns the size of the target surface for a rotozoomSurface() call */
  79.  
  80.     DLLINTERFACE void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth,
  81.                       int *dstheight);
  82.  
  83.     DLLINTERFACE void rotozoomSurfaceSizeXY
  84.     (int width, int height, double angle, double zoomx, double zoomy, 
  85.      int *dstwidth, int *dstheight);
  86.  
  87. /* 
  88.  
  89.  zoomSurface()
  90.  
  91.  Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
  92.  'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1
  93.  then the destination 32bit surface is anti-aliased. If the surface is not 8bit
  94.  or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
  95.  
  96. */
  97.  
  98.     DLLINTERFACE SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth);
  99.  
  100. /* Returns the size of the target surface for a zoomSurface() call */
  101.  
  102.     DLLINTERFACE void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight);
  103.  
  104.  
  105. /* Ends C function definitions when using C++ */
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109.  
  110. #endif                /* _SDL_rotozoom_h */
  111.