xref: /PHP-8.0/ext/gd/gd.stub.php (revision 17fa9b77)
1<?php
2
3/** @generate-function-entries */
4
5final class GdImage
6{
7}
8
9function gd_info(): array {}
10
11function imageloadfont(string $filename): int|false {}
12
13function imagesetstyle(GdImage $image, array $style): bool {}
14
15function imagecreatetruecolor(int $width, int $height): GdImage|false {}
16
17function imageistruecolor(GdImage $image): bool {}
18
19function imagetruecolortopalette(GdImage $image, bool $dither, int $num_colors): bool {}
20
21function imagepalettetotruecolor(GdImage $image): bool {}
22
23function imagecolormatch(GdImage $image1, GdImage $image2): bool {}
24
25function imagesetthickness(GdImage $image, int $thickness): bool {}
26
27function imagefilledellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): bool {}
28
29function imagefilledarc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): bool {}
30
31function imagealphablending(GdImage $image, bool $enable): bool {}
32
33function imagesavealpha(GdImage $image, bool $enable): bool {}
34
35function imagelayereffect(GdImage $image, int $effect): bool {}
36
37function imagecolorallocatealpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int|false {}
38
39function imagecolorresolvealpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int {}
40
41function imagecolorclosestalpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int {}
42
43function imagecolorexactalpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int {}
44
45function imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): bool {}
46
47#ifdef PHP_WIN32
48
49function imagegrabwindow(int $handle, bool $client_area = false): GdImage|false {}
50
51function imagegrabscreen(): GdImage|false {}
52
53#endif
54
55// TODO: $ignore_transparent is ignored???
56function imagerotate(GdImage $image, float $angle, int $background_color, bool $ignore_transparent = false): GdImage|false {}
57
58function imagesettile(GdImage $image, GdImage $tile): bool {}
59
60function imagesetbrush(GdImage $image, GdImage $brush): bool {}
61
62function imagecreate(int $width, int $height): GdImage|false {}
63
64function imagetypes(): int {}
65
66function imagecreatefromstring(string $data): GdImage|false {}
67
68function imagecreatefromgif(string $filename): GdImage|false {}
69
70#ifdef HAVE_GD_JPG
71function imagecreatefromjpeg(string $filename): GdImage|false {}
72#endif
73
74#ifdef HAVE_GD_PNG
75function imagecreatefrompng(string $filename): GdImage|false {}
76#endif
77
78#ifdef HAVE_GD_WEBP
79function imagecreatefromwebp(string $filename): GdImage|false {}
80#endif
81
82function imagecreatefromxbm(string $filename): GdImage|false {}
83
84#ifdef HAVE_GD_XPM
85function imagecreatefromxpm(string $filename): GdImage|false {}
86#endif
87
88function imagecreatefromwbmp(string $filename): GdImage|false {}
89
90function imagecreatefromgd(string $filename): GdImage|false {}
91
92function imagecreatefromgd2(string $filename): GdImage|false {}
93
94function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height): GdImage|false {}
95
96#ifdef HAVE_GD_BMP
97function imagecreatefrombmp(string $filename): GdImage|false {}
98#endif
99
100#ifdef HAVE_GD_TGA
101function imagecreatefromtga(string $filename): GdImage|false {}
102#endif
103
104function imagexbm(GdImage $image, ?string $filename, ?int $foreground_color = null): bool {}
105
106/** @param resource|string|null $file */
107function imagegif(GdImage $image, $file = null): bool {}
108
109#ifdef HAVE_GD_PNG
110/** @param resource|string|null $file */
111function imagepng(GdImage $image, $file = null, int $quality = -1, int $filters = -1): bool {}
112#endif
113
114#ifdef HAVE_GD_WEBP
115/** @param resource|string|null $file */
116function imagewebp(GdImage $image, $file = null, int $quality = -1): bool {}
117#endif
118
119#ifdef HAVE_GD_JPG
120/** @param resource|string|null $file */
121function imagejpeg(GdImage $image, $file = null, int $quality = -1): bool {}
122#endif
123
124/** @param resource|string|null $file */
125function imagewbmp(GdImage $image, $file = null, ?int $foreground_color = null): bool {}
126
127function imagegd(GdImage $image, ?string $file = null): bool {}
128
129function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = UNKNOWN, int $mode = UNKNOWN): bool {}
130
131#ifdef HAVE_GD_BMP
132/** @param resource|string|null $file */
133function imagebmp(GdImage $image, $file = null, bool $compressed = true): bool {}
134#endif
135
136function imagedestroy(GdImage $image): bool {}
137
138function imagecolorallocate(GdImage $image, int $red, int $green, int $blue): int|false {}
139
140function imagepalettecopy(GdImage $dst, GdImage $src): void {}
141
142function imagecolorat(GdImage $image, int $x, int $y): int|false {}
143
144function imagecolorclosest(GdImage $image, int $red, int $green, int $blue): int {}
145
146function imagecolorclosesthwb(GdImage $image, int $red, int $green, int $blue): int {}
147
148function imagecolordeallocate(GdImage $image, int $color): bool {}
149
150function imagecolorresolve(GdImage $image, int $red, int $green, int $blue): int {}
151
152function imagecolorexact(GdImage $image, int $red, int $green, int $blue): int {}
153
154function imagecolorset(GdImage $image, int $color, int $red, int $green, int $blue, int $alpha = 0): ?bool {}
155
156function imagecolorsforindex(GdImage $image, int $color): array {}
157
158function imagegammacorrect(GdImage $image, float $input_gamma, float $output_gamma): bool {}
159
160function imagesetpixel(GdImage $image, int $x, int $y, int $color): bool {}
161
162function imageline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {}
163
164function imagedashedline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {}
165
166function imagerectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {}
167
168function imagefilledrectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool {}
169
170function imagearc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color): bool {}
171
172function imageellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): bool {}
173
174function imagefilltoborder(GdImage $image, int $x, int $y, int $border_color, int $color): bool {}
175
176function imagefill(GdImage $image, int $x, int $y, int $color): bool {}
177
178function imagecolorstotal(GdImage $image): int {}
179
180function imagecolortransparent(GdImage $image, ?int $color = null): int {}
181
182function imageinterlace(GdImage $image, ?bool $enable = null): bool {}
183
184function imagepolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color = null): bool {}
185
186function imageopenpolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color = null): bool {}
187
188function imagefilledpolygon(GdImage $image, array $points, int $num_points_or_color, ?int $color = null): bool {}
189
190function imagefontwidth(int $font): int {}
191
192function imagefontheight(int $font): int {}
193
194function imagechar(GdImage $image, int $font, int $x, int $y, string $char, int $color): bool {}
195
196function imagecharup(GdImage $image, int $font, int $x, int $y, string $char, int $color): bool {}
197
198function imagestring(GdImage $image, int $font, int $x, int $y, string $string, int $color): bool {}
199
200function imagestringup(GdImage $image, int $font, int $x, int $y, string $string, int $color): bool {}
201
202function imagecopy(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height): bool {}
203
204function imagecopymerge(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): bool {}
205
206function imagecopymergegray(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_width, int $src_height, int $pct): bool {}
207
208function imagecopyresized(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): bool {}
209
210function imagesx(GdImage $image): int {}
211
212function imagesy(GdImage $image): int {}
213
214function imagesetclip(GdImage $image, int $x1, int $y1, int $x2, int $y2): bool {}
215
216function imagegetclip(GdImage $image): array {}
217
218#ifdef HAVE_GD_FREETYPE
219function imageftbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array|false {}
220
221function imagefttext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {}
222
223/** @alias imageftbbox */
224function imagettfbbox(float $size, float $angle, string $font_filename, string $string, array $options = []): array|false {}
225
226/** @alias imagefttext */
227function imagettftext(GdImage $image, float $size, float $angle, int $x, int $y, int $color, string $font_filename, string $text, array $options = []): array|false {}
228#endif
229
230/** @param array|int|float|bool $args */
231function imagefilter(GdImage $image, int $filter, ...$args): bool {}
232
233function imageconvolution(GdImage $image, array $matrix, float $divisor, float $offset): bool {}
234
235function imageflip(GdImage $image, int $mode): bool {}
236
237function imageantialias(GdImage $image, bool $enable): bool {}
238
239function imagecrop(GdImage $image, array $rectangle): GdImage|false {}
240
241function imagecropauto(GdImage $image, int $mode = IMG_CROP_DEFAULT, float $threshold = 0.5, int $color = -1): GdImage|false {}
242
243function imagescale(GdImage $image, int $width, int $height = -1, int $mode = IMG_BILINEAR_FIXED): GdImage|false {}
244
245function imageaffine(GdImage $image, array $affine, ?array $clip = null): GdImage|false {}
246
247/** @param array|float $options */
248function imageaffinematrixget(int $type, $options): array|false {}
249
250function imageaffinematrixconcat(array $matrix1, array $matrix2): array|false {}
251
252function imagegetinterpolation(GdImage $image): int {}
253
254function imagesetinterpolation(GdImage $image, int $method = IMG_BILINEAR_FIXED): bool {}
255
256function imageresolution(GdImage $image, ?int $resolution_x = null, ?int $resolution_y = null): array|bool {}
257
258