php_gd.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 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. /* $Id$ */
  20. #ifndef PHP_GD_H
  21. #define PHP_GD_H
  22. #if HAVE_LIBFREETYPE
  23. # ifndef ENABLE_GD_TTF
  24. # define ENABLE_GD_TTF
  25. # endif
  26. #endif
  27. #if defined(HAVE_LIBGD) || defined(HAVE_GD_BUNDLED)
  28. /* open_basedir and safe_mode checks */
  29. #define PHP_GD_CHECK_OPEN_BASEDIR(filename, errormsg) \
  30. if (!filename || php_check_open_basedir(filename TSRMLS_CC)) { \
  31. php_error_docref(NULL TSRMLS_CC, E_WARNING, errormsg); \
  32. RETURN_FALSE; \
  33. }
  34. #define PHP_GDIMG_TYPE_GIF 1
  35. #define PHP_GDIMG_TYPE_PNG 2
  36. #define PHP_GDIMG_TYPE_JPG 3
  37. #define PHP_GDIMG_TYPE_WBM 4
  38. #define PHP_GDIMG_TYPE_XBM 5
  39. #define PHP_GDIMG_TYPE_XPM 6
  40. #define PHP_GDIMG_CONVERT_WBM 7
  41. #define PHP_GDIMG_TYPE_GD 8
  42. #define PHP_GDIMG_TYPE_GD2 9
  43. #define PHP_GDIMG_TYPE_GD2PART 10
  44. #define PHP_GDIMG_TYPE_WEBP 11
  45. #ifdef PHP_WIN32
  46. # define PHP_GD_API __declspec(dllexport)
  47. #elif defined(__GNUC__) && __GNUC__ >= 4
  48. # define PHP_GD_API __attribute__ ((visibility("default")))
  49. #else
  50. # define PHP_GD_API
  51. #endif
  52. PHPAPI extern const char php_sig_gif[3];
  53. PHPAPI extern const char php_sig_jpg[3];
  54. PHPAPI extern const char php_sig_png[8];
  55. extern zend_module_entry gd_module_entry;
  56. #define phpext_gd_ptr &gd_module_entry
  57. /* gd.c functions */
  58. PHP_MINFO_FUNCTION(gd);
  59. PHP_MINIT_FUNCTION(gd);
  60. #if HAVE_LIBT1
  61. PHP_MSHUTDOWN_FUNCTION(gd);
  62. #endif
  63. #if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE
  64. PHP_RSHUTDOWN_FUNCTION(gd);
  65. #endif
  66. PHP_FUNCTION(gd_info);
  67. PHP_FUNCTION(imagearc);
  68. PHP_FUNCTION(imageellipse);
  69. PHP_FUNCTION(imagechar);
  70. PHP_FUNCTION(imagecharup);
  71. PHP_FUNCTION(imageistruecolor);
  72. PHP_FUNCTION(imagecolorallocate);
  73. PHP_FUNCTION(imagepalettecopy);
  74. PHP_FUNCTION(imagecolorat);
  75. PHP_FUNCTION(imagecolorclosest);
  76. PHP_FUNCTION(imagecolorclosesthwb);
  77. PHP_FUNCTION(imagecolordeallocate);
  78. PHP_FUNCTION(imagecolorresolve);
  79. PHP_FUNCTION(imagecolorexact);
  80. PHP_FUNCTION(imagecolorset);
  81. PHP_FUNCTION(imagecolorstotal);
  82. PHP_FUNCTION(imagecolorsforindex);
  83. PHP_FUNCTION(imagecolortransparent);
  84. PHP_FUNCTION(imagecopy);
  85. PHP_FUNCTION(imagecopymerge);
  86. PHP_FUNCTION(imagecopyresized);
  87. PHP_FUNCTION(imagetypes);
  88. PHP_FUNCTION(imagecreate);
  89. PHP_FUNCTION(imageftbbox);
  90. PHP_FUNCTION(imagefttext);
  91. PHP_FUNCTION(imagecreatetruecolor);
  92. PHP_FUNCTION(imagetruecolortopalette);
  93. PHP_FUNCTION(imagepalettetotruecolor);
  94. PHP_FUNCTION(imagesetthickness);
  95. PHP_FUNCTION(imagefilledellipse);
  96. PHP_FUNCTION(imagefilledarc);
  97. PHP_FUNCTION(imagealphablending);
  98. PHP_FUNCTION(imagesavealpha);
  99. PHP_FUNCTION(imagecolorallocatealpha);
  100. PHP_FUNCTION(imagecolorresolvealpha);
  101. PHP_FUNCTION(imagecolorclosestalpha);
  102. PHP_FUNCTION(imagecolorexactalpha);
  103. PHP_FUNCTION(imagecopyresampled);
  104. #ifdef PHP_WIN32
  105. PHP_FUNCTION(imagegrabwindow);
  106. PHP_FUNCTION(imagegrabscreen);
  107. #endif
  108. PHP_FUNCTION(imagerotate);
  109. PHP_FUNCTION(imageflip);
  110. #ifdef HAVE_GD_BUNDLED
  111. PHP_FUNCTION(imageantialias);
  112. #endif
  113. PHP_FUNCTION(imagecrop);
  114. PHP_FUNCTION(imagecropauto);
  115. PHP_FUNCTION(imagescale);
  116. PHP_FUNCTION(imageaffine);
  117. PHP_FUNCTION(imageaffinematrixget);
  118. PHP_FUNCTION(imageaffinematrixconcat);
  119. PHP_FUNCTION(imagesetinterpolation);
  120. PHP_FUNCTION(imagesetthickness);
  121. PHP_FUNCTION(imagecopymergegray);
  122. PHP_FUNCTION(imagesetbrush);
  123. PHP_FUNCTION(imagesettile);
  124. PHP_FUNCTION(imagesetstyle);
  125. PHP_FUNCTION(imagecreatefromstring);
  126. PHP_FUNCTION(imagecreatefromgif);
  127. PHP_FUNCTION(imagecreatefromjpeg);
  128. PHP_FUNCTION(imagecreatefromxbm);
  129. PHP_FUNCTION(imagecreatefromwebp);
  130. PHP_FUNCTION(imagecreatefrompng);
  131. PHP_FUNCTION(imagecreatefromwbmp);
  132. PHP_FUNCTION(imagecreatefromgd);
  133. PHP_FUNCTION(imagecreatefromgd2);
  134. PHP_FUNCTION(imagecreatefromgd2part);
  135. #if defined(HAVE_GD_XPM)
  136. PHP_FUNCTION(imagecreatefromxpm);
  137. #endif
  138. PHP_FUNCTION(imagegammacorrect);
  139. PHP_FUNCTION(imagedestroy);
  140. PHP_FUNCTION(imagefill);
  141. PHP_FUNCTION(imagefilledpolygon);
  142. PHP_FUNCTION(imagefilledrectangle);
  143. PHP_FUNCTION(imagefilltoborder);
  144. PHP_FUNCTION(imagefontwidth);
  145. PHP_FUNCTION(imagefontheight);
  146. PHP_FUNCTION(imagegif );
  147. PHP_FUNCTION(imagejpeg );
  148. PHP_FUNCTION(imagepng);
  149. PHP_FUNCTION(imagewebp);
  150. PHP_FUNCTION(imagewbmp);
  151. PHP_FUNCTION(imagegd);
  152. PHP_FUNCTION(imagegd2);
  153. PHP_FUNCTION(imageinterlace);
  154. PHP_FUNCTION(imageline);
  155. PHP_FUNCTION(imageloadfont);
  156. PHP_FUNCTION(imagepolygon);
  157. PHP_FUNCTION(imagerectangle);
  158. PHP_FUNCTION(imagesetpixel);
  159. PHP_FUNCTION(imagestring);
  160. PHP_FUNCTION(imagestringup);
  161. PHP_FUNCTION(imagesx);
  162. PHP_FUNCTION(imagesy);
  163. PHP_FUNCTION(imagedashedline);
  164. PHP_FUNCTION(imagettfbbox);
  165. PHP_FUNCTION(imagettftext);
  166. PHP_FUNCTION(imagepsloadfont);
  167. /*
  168. PHP_FUNCTION(imagepscopyfont);
  169. */
  170. PHP_FUNCTION(imagepsfreefont);
  171. PHP_FUNCTION(imagepsencodefont);
  172. PHP_FUNCTION(imagepsextendfont);
  173. PHP_FUNCTION(imagepsslantfont);
  174. PHP_FUNCTION(imagepstext);
  175. PHP_FUNCTION(imagepsbbox);
  176. PHP_FUNCTION(jpeg2wbmp);
  177. PHP_FUNCTION(png2wbmp);
  178. PHP_FUNCTION(image2wbmp);
  179. PHP_FUNCTION(imagecolormatch);
  180. PHP_FUNCTION(imagelayereffect);
  181. PHP_FUNCTION(imagexbm);
  182. PHP_FUNCTION(imagefilter);
  183. PHP_FUNCTION(imageconvolution);
  184. PHP_GD_API int phpi_get_le_gd(void);
  185. #else
  186. #define phpext_gd_ptr NULL
  187. #endif
  188. #endif /* PHP_GD_H */