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