xref: /PHP-7.2/ext/gd/php_gd.h (revision 7a7ec01a)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2018 The PHP Group                                |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Authors: Rasmus Lerdorf <rasmus@php.net>                             |
16    |          Stig Bakken <ssb@php.net>                                   |
17    +----------------------------------------------------------------------+
18 */
19 
20 /* $Id$ */
21 
22 #ifndef PHP_GD_H
23 #define PHP_GD_H
24 
25 #if HAVE_LIBFREETYPE
26 # ifndef ENABLE_GD_TTF
27 #  define ENABLE_GD_TTF
28 # endif
29 #endif
30 
31 #if defined(HAVE_LIBGD) || defined(HAVE_GD_BUNDLED)
32 
33 /* open_basedir and safe_mode checks */
34 #define PHP_GD_CHECK_OPEN_BASEDIR(filename, errormsg)                       \
35 	if (!filename || php_check_open_basedir(filename)) {      \
36 		php_error_docref(NULL, E_WARNING, errormsg);      \
37 		RETURN_FALSE;                                               \
38 	}
39 
40 #define PHP_GDIMG_TYPE_GIF      1
41 #define PHP_GDIMG_TYPE_PNG      2
42 #define PHP_GDIMG_TYPE_JPG      3
43 #define PHP_GDIMG_TYPE_WBM      4
44 #define PHP_GDIMG_TYPE_XBM      5
45 #define PHP_GDIMG_TYPE_XPM      6
46 #define PHP_GDIMG_CONVERT_WBM   7
47 #define PHP_GDIMG_TYPE_GD       8
48 #define PHP_GDIMG_TYPE_GD2      9
49 #define PHP_GDIMG_TYPE_GD2PART  10
50 #define PHP_GDIMG_TYPE_WEBP     11
51 #define PHP_GDIMG_TYPE_BMP      12
52 
53 #ifdef PHP_WIN32
54 #	define PHP_GD_API __declspec(dllexport)
55 #elif defined(__GNUC__) && __GNUC__ >= 4
56 #	define PHP_GD_API __attribute__ ((visibility("default")))
57 #else
58 #	define PHP_GD_API
59 #endif
60 
61 PHPAPI extern const char php_sig_gif[3];
62 PHPAPI extern const char php_sig_jpg[3];
63 PHPAPI extern const char php_sig_png[8];
64 PHPAPI extern const char php_sig_bmp[2];
65 
66 extern zend_module_entry gd_module_entry;
67 #define phpext_gd_ptr &gd_module_entry
68 
69 #include "php_version.h"
70 #define PHP_GD_VERSION PHP_VERSION
71 
72 /* gd.c functions */
73 PHP_MINFO_FUNCTION(gd);
74 PHP_MINIT_FUNCTION(gd);
75 #if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
76 PHP_RSHUTDOWN_FUNCTION(gd);
77 #endif
78 
79 PHP_FUNCTION(gd_info);
80 PHP_FUNCTION(imagearc);
81 PHP_FUNCTION(imageellipse);
82 PHP_FUNCTION(imagechar);
83 PHP_FUNCTION(imagecharup);
84 PHP_FUNCTION(imageistruecolor);
85 PHP_FUNCTION(imagecolorallocate);
86 PHP_FUNCTION(imagepalettecopy);
87 PHP_FUNCTION(imagecolorat);
88 PHP_FUNCTION(imagecolorclosest);
89 PHP_FUNCTION(imagecolorclosesthwb);
90 PHP_FUNCTION(imagecolordeallocate);
91 PHP_FUNCTION(imagecolorresolve);
92 PHP_FUNCTION(imagecolorexact);
93 PHP_FUNCTION(imagecolorset);
94 PHP_FUNCTION(imagecolorstotal);
95 PHP_FUNCTION(imagecolorsforindex);
96 PHP_FUNCTION(imagecolortransparent);
97 PHP_FUNCTION(imagecopy);
98 PHP_FUNCTION(imagecopymerge);
99 PHP_FUNCTION(imagecopyresized);
100 PHP_FUNCTION(imagetypes);
101 PHP_FUNCTION(imagecreate);
102 PHP_FUNCTION(imageftbbox);
103 PHP_FUNCTION(imagefttext);
104 
105 PHP_FUNCTION(imagecreatetruecolor);
106 PHP_FUNCTION(imagetruecolortopalette);
107 PHP_FUNCTION(imagepalettetotruecolor);
108 PHP_FUNCTION(imagesetthickness);
109 PHP_FUNCTION(imagefilledellipse);
110 PHP_FUNCTION(imagefilledarc);
111 PHP_FUNCTION(imagealphablending);
112 PHP_FUNCTION(imagesavealpha);
113 PHP_FUNCTION(imagecolorallocatealpha);
114 PHP_FUNCTION(imagecolorresolvealpha);
115 PHP_FUNCTION(imagecolorclosestalpha);
116 PHP_FUNCTION(imagecolorexactalpha);
117 PHP_FUNCTION(imagecopyresampled);
118 
119 #ifdef PHP_WIN32
120 PHP_FUNCTION(imagegrabwindow);
121 PHP_FUNCTION(imagegrabscreen);
122 #endif
123 
124 PHP_FUNCTION(imagerotate);
125 
126 PHP_FUNCTION(imageflip);
127 
128 PHP_FUNCTION(imageantialias);
129 
130 PHP_FUNCTION(imagecrop);
131 PHP_FUNCTION(imagecropauto);
132 PHP_FUNCTION(imagescale);
133 PHP_FUNCTION(imageaffine);
134 PHP_FUNCTION(imageaffinematrixget);
135 PHP_FUNCTION(imageaffinematrixconcat);
136 PHP_FUNCTION(imagesetinterpolation);
137 
138 PHP_FUNCTION(imagesetthickness);
139 PHP_FUNCTION(imagecopymergegray);
140 PHP_FUNCTION(imagesetbrush);
141 PHP_FUNCTION(imagesettile);
142 PHP_FUNCTION(imagesetstyle);
143 
144 PHP_FUNCTION(imagecreatefromstring);
145 PHP_FUNCTION(imagecreatefromgif);
146 PHP_FUNCTION(imagecreatefromjpeg);
147 PHP_FUNCTION(imagecreatefromxbm);
148 PHP_FUNCTION(imagecreatefromwebp);
149 PHP_FUNCTION(imagecreatefrompng);
150 PHP_FUNCTION(imagecreatefromwbmp);
151 PHP_FUNCTION(imagecreatefromgd);
152 PHP_FUNCTION(imagecreatefromgd2);
153 PHP_FUNCTION(imagecreatefromgd2part);
154 #if defined(HAVE_GD_BMP)
155 PHP_FUNCTION(imagecreatefrombmp);
156 #endif
157 #if defined(HAVE_GD_XPM)
158 PHP_FUNCTION(imagecreatefromxpm);
159 #endif
160 
161 PHP_FUNCTION(imagegammacorrect);
162 PHP_FUNCTION(imagedestroy);
163 PHP_FUNCTION(imagefill);
164 PHP_FUNCTION(imagefilledpolygon);
165 PHP_FUNCTION(imagefilledrectangle);
166 PHP_FUNCTION(imagefilltoborder);
167 PHP_FUNCTION(imagefontwidth);
168 PHP_FUNCTION(imagefontheight);
169 
170 PHP_FUNCTION(imagegif );
171 PHP_FUNCTION(imagejpeg );
172 PHP_FUNCTION(imagepng);
173 PHP_FUNCTION(imagewebp);
174 PHP_FUNCTION(imagewbmp);
175 PHP_FUNCTION(imagegd);
176 PHP_FUNCTION(imagegd2);
177 #if defined(HAVE_GD_BMP)
178 PHP_FUNCTION(imagebmp);
179 #endif
180 
181 PHP_FUNCTION(imageinterlace);
182 PHP_FUNCTION(imageline);
183 PHP_FUNCTION(imageloadfont);
184 PHP_FUNCTION(imagepolygon);
185 PHP_FUNCTION(imageopenpolygon);
186 PHP_FUNCTION(imagerectangle);
187 PHP_FUNCTION(imagesetpixel);
188 PHP_FUNCTION(imagestring);
189 PHP_FUNCTION(imagestringup);
190 PHP_FUNCTION(imagesx);
191 PHP_FUNCTION(imagesy);
192 PHP_FUNCTION(imagesetclip);
193 PHP_FUNCTION(imagegetclip);
194 PHP_FUNCTION(imagedashedline);
195 PHP_FUNCTION(imagettfbbox);
196 PHP_FUNCTION(imagettftext);
197 
198 PHP_FUNCTION(jpeg2wbmp);
199 PHP_FUNCTION(png2wbmp);
200 PHP_FUNCTION(image2wbmp);
201 
202 PHP_FUNCTION(imagecolormatch);
203 
204 PHP_FUNCTION(imagelayereffect);
205 PHP_FUNCTION(imagexbm);
206 
207 PHP_FUNCTION(imagefilter);
208 PHP_FUNCTION(imageconvolution);
209 
210 PHP_FUNCTION(imageresolution);
211 
212 PHP_GD_API int phpi_get_le_gd(void);
213 
214 #else
215 
216 #define phpext_gd_ptr NULL
217 
218 #endif
219 
220 #endif /* PHP_GD_H */
221