1
0

gd.php 11 KB

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