1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
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
52 #ifdef PHP_WIN32
53 # define PHP_GD_API __declspec(dllexport)
54 #elif defined(__GNUC__) && __GNUC__ >= 4
55 # define PHP_GD_API __attribute__ ((visibility("default")))
56 #else
57 # define PHP_GD_API
58 #endif
59
60 PHPAPI extern const char php_sig_gif[3];
61 PHPAPI extern const char php_sig_jpg[3];
62 PHPAPI extern const char php_sig_png[8];
63
64 extern zend_module_entry gd_module_entry;
65 #define phpext_gd_ptr &gd_module_entry
66
67 #include "php_version.h"
68 #define PHP_GD_VERSION PHP_VERSION
69
70
71 PHP_MINFO_FUNCTION(gd);
72 PHP_MINIT_FUNCTION(gd);
73 #if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
74 PHP_RSHUTDOWN_FUNCTION(gd);
75 #endif
76
77 PHP_FUNCTION(gd_info);
78 PHP_FUNCTION(imagearc);
79 PHP_FUNCTION(imageellipse);
80 PHP_FUNCTION(imagechar);
81 PHP_FUNCTION(imagecharup);
82 PHP_FUNCTION(imageistruecolor);
83 PHP_FUNCTION(imagecolorallocate);
84 PHP_FUNCTION(imagepalettecopy);
85 PHP_FUNCTION(imagecolorat);
86 PHP_FUNCTION(imagecolorclosest);
87 PHP_FUNCTION(imagecolorclosesthwb);
88 PHP_FUNCTION(imagecolordeallocate);
89 PHP_FUNCTION(imagecolorresolve);
90 PHP_FUNCTION(imagecolorexact);
91 PHP_FUNCTION(imagecolorset);
92 PHP_FUNCTION(imagecolorstotal);
93 PHP_FUNCTION(imagecolorsforindex);
94 PHP_FUNCTION(imagecolortransparent);
95 PHP_FUNCTION(imagecopy);
96 PHP_FUNCTION(imagecopymerge);
97 PHP_FUNCTION(imagecopyresized);
98 PHP_FUNCTION(imagetypes);
99 PHP_FUNCTION(imagecreate);
100 PHP_FUNCTION(imageftbbox);
101 PHP_FUNCTION(imagefttext);
102
103 PHP_FUNCTION(imagecreatetruecolor);
104 PHP_FUNCTION(imagetruecolortopalette);
105 PHP_FUNCTION(imagepalettetotruecolor);
106 PHP_FUNCTION(imagesetthickness);
107 PHP_FUNCTION(imagefilledellipse);
108 PHP_FUNCTION(imagefilledarc);
109 PHP_FUNCTION(imagealphablending);
110 PHP_FUNCTION(imagesavealpha);
111 PHP_FUNCTION(imagecolorallocatealpha);
112 PHP_FUNCTION(imagecolorresolvealpha);
113 PHP_FUNCTION(imagecolorclosestalpha);
114 PHP_FUNCTION(imagecolorexactalpha);
115 PHP_FUNCTION(imagecopyresampled);
116
117 #ifdef PHP_WIN32
118 PHP_FUNCTION(imagegrabwindow);
119 PHP_FUNCTION(imagegrabscreen);
120 #endif
121
122 PHP_FUNCTION(imagerotate);
123
124 PHP_FUNCTION(imageflip);
125
126 #ifdef HAVE_GD_BUNDLED
127 PHP_FUNCTION(imageantialias);
128 #endif
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_XPM)
155 PHP_FUNCTION(imagecreatefromxpm);
156 #endif
157
158 PHP_FUNCTION(imagegammacorrect);
159 PHP_FUNCTION(imagedestroy);
160 PHP_FUNCTION(imagefill);
161 PHP_FUNCTION(imagefilledpolygon);
162 PHP_FUNCTION(imagefilledrectangle);
163 PHP_FUNCTION(imagefilltoborder);
164 PHP_FUNCTION(imagefontwidth);
165 PHP_FUNCTION(imagefontheight);
166
167 PHP_FUNCTION(imagegif );
168 PHP_FUNCTION(imagejpeg );
169 PHP_FUNCTION(imagepng);
170 PHP_FUNCTION(imagewebp);
171 PHP_FUNCTION(imagewbmp);
172 PHP_FUNCTION(imagegd);
173 PHP_FUNCTION(imagegd2);
174
175 PHP_FUNCTION(imageinterlace);
176 PHP_FUNCTION(imageline);
177 PHP_FUNCTION(imageloadfont);
178 PHP_FUNCTION(imagepolygon);
179 PHP_FUNCTION(imagerectangle);
180 PHP_FUNCTION(imagesetpixel);
181 PHP_FUNCTION(imagestring);
182 PHP_FUNCTION(imagestringup);
183 PHP_FUNCTION(imagesx);
184 PHP_FUNCTION(imagesy);
185 PHP_FUNCTION(imagedashedline);
186 PHP_FUNCTION(imagettfbbox);
187 PHP_FUNCTION(imagettftext);
188
189 PHP_FUNCTION(jpeg2wbmp);
190 PHP_FUNCTION(png2wbmp);
191 PHP_FUNCTION(image2wbmp);
192
193 PHP_FUNCTION(imagecolormatch);
194
195 PHP_FUNCTION(imagelayereffect);
196 PHP_FUNCTION(imagexbm);
197
198 PHP_FUNCTION(imagefilter);
199 PHP_FUNCTION(imageconvolution);
200
201 PHP_GD_API int phpi_get_le_gd(void);
202
203 #else
204
205 #define phpext_gd_ptr NULL
206
207 #endif
208
209 #endif