Freeciv-3.2
Loading...
Searching...
No Matches
SDL3_rotozoom.h
Go to the documentation of this file.
1/*
2
3SDL2_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces
4
5Copyright (C) 2012-2014 Andreas Schiffler
6
7This software is provided 'as-is', without any express or implied
8warranty. In no event will the authors be held liable for any damages
9arising from the use of this software.
10
11Permission is granted to anyone to use this software for any purpose,
12including commercial applications, and to alter it and redistribute it
13freely, subject to the following restrictions:
14
151. The origin of this software must not be misrepresented; you must not
16claim that you wrote the original software. If you use this software
17in a product, an acknowledgment in the product documentation would be
18appreciated but is not required.
19
202. Altered source versions must be plainly marked as such, and must not be
21misrepresented as being the original software.
22
233. This notice may not be removed or altered from any source
24distribution.
25
26Andreas Schiffler -- aschiffler at ferzkopp dot net
27
28*/
29
30#ifndef _SDL3_rotozoom_h
31#define _SDL3_rotozoom_h
32
33#include <math.h>
34
35/* Set up for C function definitions, even when using C++ */
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40#ifndef M_PI
41#define M_PI 3.1415926535897932384626433832795
42#endif
43
44#include "fc_prehdrs.h"
45
46/* SDL3 */
47#include <SDL3/SDL.h>
48
49 /* ---- Defines */
50
54#define SMOOTHING_OFF 0
55
59#define SMOOTHING_ON 1
60
61 /* ---- Function Prototypes */
62
63#ifdef _MSC_VER
64# if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT)
65# define SDL2_ROTOZOOM_SCOPE __declspec(dllexport)
66# else
67# ifdef LIBSDL2_GFX_DLL_IMPORT
68# define SDL2_ROTOZOOM_SCOPE __declspec(dllimport)
69# endif
70# endif
71#endif
72#ifndef SDL2_ROTOZOOM_SCOPE
73# define SDL2_ROTOZOOM_SCOPE extern
74#endif
75
76 /*
77
78 Rotozoom functions
79
80 */
81
83
85 (SDL_Surface * src, double angle, double zoomx, double zoomy, int smooth);
86
87
88 SDL2_ROTOZOOM_SCOPE void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth,
89 int *dstheight);
90
92 (int width, int height, double angle, double zoomx, double zoomy,
93 int *dstwidth, int *dstheight);
94
95 /*
96
97 Zooming functions
98
99 */
100
102
103 SDL2_ROTOZOOM_SCOPE void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight);
104
105 /*
106
107 Shrinking functions
108
109 */
110
112
113 /*
114
115 Specialized rotation functions
116
117 */
118
120
121 /* Ends C function definitions when using C++ */
122#ifdef __cplusplus
123}
124#endif
125
126#endif /* _SDL3_rotozoom_h */
SDL2_ROTOZOOM_SCOPE SDL_Surface * rotozoomSurface(SDL_Surface *src, double angle, double zoom, int smooth)
Rotates and zooms a surface and optional anti-aliasing.
SDL2_ROTOZOOM_SCOPE 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-...
SDL2_ROTOZOOM_SCOPE 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.
SDL2_ROTOZOOM_SCOPE SDL_Surface * zoomSurface(SDL_Surface *src, double zoomx, double zoomy, int smooth)
Zoom a surface by independent horizontal and vertical factors with optional smoothing.
SDL2_ROTOZOOM_SCOPE 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.
SDL2_ROTOZOOM_SCOPE 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.
#define SDL2_ROTOZOOM_SCOPE
SDL2_ROTOZOOM_SCOPE SDL_Surface * shrinkSurface(SDL_Surface *src, int factorx, int factory)
Shrink a surface by an integer ratio using averaging.
SDL2_ROTOZOOM_SCOPE SDL_Surface * rotateSurface90Degrees(SDL_Surface *src, int numClockwiseTurns)
Rotates a 8/16/24/32 bit surface in increments of 90 degrees.
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
struct canvas int int struct sprite int int int width
Definition canvas_g.h:44
char * incite_cost
Definition comments.c:75