2003-02-26 23:21:44 +00:00
|
|
|
/*
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2004-01-08 17:33:29 +00:00
|
|
|
| PHP Version 5 |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2007-12-31 07:17:19 +00:00
|
|
|
| Copyright (c) 1997-2008 The PHP Group |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 12:51:34 +00:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
2000-07-24 01:40:02 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-10 20:04:29 +00:00
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 12:51:34 +00:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
2000-07-24 01:40:02 +00:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2002-02-28 08:29:35 +00:00
|
|
|
| Authors: Rasmus Lerdorf <rasmus@php.net> |
|
2003-03-18 12:06:09 +00:00
|
|
|
| Stig Bakken <ssb@php.net> |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 01:40:02 +00:00
|
|
|
*/
|
1999-04-17 00:37:12 +00:00
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#ifndef PHP_GD_H
|
|
|
|
#define PHP_GD_H
|
1999-04-17 00:37:12 +00:00
|
|
|
|
1999-10-17 14:57:49 +00:00
|
|
|
#define HAVE_GDIMAGECREATEFROMPNG 1
|
1999-07-23 15:18:37 +00:00
|
|
|
|
1999-08-19 05:23:02 +00:00
|
|
|
#if HAVE_LIBTTF|HAVE_LIBFREETYPE
|
1999-07-23 15:18:37 +00:00
|
|
|
#define ENABLE_GD_TTF
|
|
|
|
#endif
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
#if HAVE_LIBGD
|
|
|
|
|
2005-11-01 17:05:09 +00:00
|
|
|
/* open_basedir and safe_mode checks */
|
|
|
|
#define PHP_GD_CHECK_OPEN_BASEDIR(filename, errormsg) \
|
|
|
|
if (!filename || php_check_open_basedir(filename TSRMLS_CC) || \
|
2005-11-02 21:26:25 +00:00
|
|
|
(PG(safe_mode) && !php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR)) \
|
2005-11-01 17:05:09 +00:00
|
|
|
) { \
|
|
|
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, errormsg); \
|
|
|
|
RETURN_FALSE; \
|
|
|
|
}
|
|
|
|
|
2001-05-29 07:46:07 +00:00
|
|
|
#define PHP_GDIMG_TYPE_GIF 1
|
|
|
|
#define PHP_GDIMG_TYPE_PNG 2
|
|
|
|
#define PHP_GDIMG_TYPE_JPG 3
|
|
|
|
#define PHP_GDIMG_TYPE_WBM 4
|
|
|
|
#define PHP_GDIMG_TYPE_XBM 5
|
|
|
|
#define PHP_GDIMG_TYPE_XPM 6
|
|
|
|
#define PHP_GDIMG_CONVERT_WBM 7
|
|
|
|
#define PHP_GDIMG_TYPE_GD 8
|
|
|
|
#define PHP_GDIMG_TYPE_GD2 9
|
|
|
|
#define PHP_GDIMG_TYPE_GD2PART 10
|
2000-06-07 00:37:49 +00:00
|
|
|
|
2001-02-20 18:00:44 +00:00
|
|
|
#ifdef PHP_WIN32
|
2008-01-30 09:41:12 +00:00
|
|
|
# define PHP_GD_API __declspec(dllexport)
|
|
|
|
#elif defined(__GNUC__) && __GNUC__ >= 4
|
|
|
|
# define PHP_GD_API __attribute__ ((visibility("default")))
|
2001-02-20 18:00:44 +00:00
|
|
|
#else
|
2008-01-30 09:41:12 +00:00
|
|
|
# define PHP_GD_API
|
2001-02-20 18:00:44 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
PHPAPI extern const char php_sig_gif[3];
|
|
|
|
PHPAPI extern const char php_sig_jpg[3];
|
|
|
|
PHPAPI extern const char php_sig_png[3];
|
2000-06-07 00:37:49 +00:00
|
|
|
|
1999-12-17 20:55:31 +00:00
|
|
|
extern zend_module_entry gd_module_entry;
|
1999-05-03 11:11:23 +00:00
|
|
|
#define phpext_gd_ptr &gd_module_entry
|
1999-04-17 00:37:12 +00:00
|
|
|
|
|
|
|
/* gd.c functions */
|
1999-07-27 19:44:46 +00:00
|
|
|
PHP_MINFO_FUNCTION(gd);
|
2001-07-30 01:56:43 +00:00
|
|
|
PHP_MINIT_FUNCTION(gd);
|
2007-04-04 01:58:24 +00:00
|
|
|
#if HAVE_LIBT1 || HAVE_GD_FONTMUTEX
|
2001-07-30 01:56:43 +00:00
|
|
|
PHP_MSHUTDOWN_FUNCTION(gd);
|
2007-04-04 01:58:24 +00:00
|
|
|
#endif
|
2003-03-31 08:49:19 +00:00
|
|
|
#if HAVE_LIBGD20 && HAVE_GD_STRINGFT
|
2002-11-23 22:11:59 +00:00
|
|
|
PHP_RSHUTDOWN_FUNCTION(gd);
|
2003-03-31 08:49:19 +00:00
|
|
|
#endif
|
1999-07-27 19:44:46 +00:00
|
|
|
|
2002-11-12 11:49:11 +00:00
|
|
|
PHP_FUNCTION(gd_info);
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagearc);
|
2003-01-26 01:15:02 +00:00
|
|
|
PHP_FUNCTION(imageellipse);
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagechar);
|
|
|
|
PHP_FUNCTION(imagecharup);
|
2002-12-06 02:16:06 +00:00
|
|
|
PHP_FUNCTION(imageistruecolor);
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagecolorallocate);
|
2000-06-25 02:55:31 +00:00
|
|
|
PHP_FUNCTION(imagepalettecopy);
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagecolorat);
|
|
|
|
PHP_FUNCTION(imagecolorclosest);
|
2000-06-25 02:55:31 +00:00
|
|
|
PHP_FUNCTION(imagecolorclosesthwb);
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagecolordeallocate);
|
|
|
|
PHP_FUNCTION(imagecolorresolve);
|
|
|
|
PHP_FUNCTION(imagecolorexact);
|
|
|
|
PHP_FUNCTION(imagecolorset);
|
|
|
|
PHP_FUNCTION(imagecolorstotal);
|
|
|
|
PHP_FUNCTION(imagecolorsforindex);
|
|
|
|
PHP_FUNCTION(imagecolortransparent);
|
|
|
|
PHP_FUNCTION(imagecopy);
|
2000-06-25 02:55:31 +00:00
|
|
|
PHP_FUNCTION(imagecopymerge);
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagecopyresized);
|
2000-07-14 21:51:31 +00:00
|
|
|
PHP_FUNCTION(imagetypes);
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagecreate);
|
2001-07-05 21:23:28 +00:00
|
|
|
PHP_FUNCTION(imageftbbox);
|
|
|
|
PHP_FUNCTION(imagefttext);
|
2001-04-13 12:00:12 +00:00
|
|
|
|
2003-01-26 01:15:02 +00:00
|
|
|
#ifdef HAVE_LIBGD20
|
2001-04-13 12:00:12 +00:00
|
|
|
PHP_FUNCTION(imagecreatetruecolor);
|
|
|
|
PHP_FUNCTION(imagetruecolortopalette);
|
|
|
|
PHP_FUNCTION(imagesetthickness);
|
|
|
|
PHP_FUNCTION(imagefilledellipse);
|
|
|
|
PHP_FUNCTION(imagefilledarc);
|
|
|
|
PHP_FUNCTION(imagealphablending);
|
2003-02-26 23:21:44 +00:00
|
|
|
PHP_FUNCTION(imagesavealpha);
|
2003-01-26 01:15:02 +00:00
|
|
|
PHP_FUNCTION(imagecolorallocatealpha);
|
2001-04-13 12:00:12 +00:00
|
|
|
PHP_FUNCTION(imagecolorresolvealpha);
|
|
|
|
PHP_FUNCTION(imagecolorclosestalpha);
|
|
|
|
PHP_FUNCTION(imagecolorexactalpha);
|
|
|
|
PHP_FUNCTION(imagecopyresampled);
|
2003-01-26 01:15:02 +00:00
|
|
|
#endif
|
2002-10-29 01:15:44 +00:00
|
|
|
|
2007-04-17 15:31:45 +00:00
|
|
|
#ifdef PHP_WIN32
|
|
|
|
PHP_FUNCTION(imagegrabwindow);
|
|
|
|
PHP_FUNCTION(imagegrabscreen);
|
|
|
|
#endif
|
|
|
|
|
2002-10-29 01:15:44 +00:00
|
|
|
#ifdef HAVE_GD_BUNDLED
|
|
|
|
PHP_FUNCTION(imagerotate);
|
2002-12-11 20:45:47 +00:00
|
|
|
PHP_FUNCTION(imageantialias);
|
2002-10-29 01:15:44 +00:00
|
|
|
#endif
|
|
|
|
|
2001-04-13 12:00:12 +00:00
|
|
|
PHP_FUNCTION(imagesetthickness);
|
|
|
|
PHP_FUNCTION(imagecopymergegray);
|
|
|
|
PHP_FUNCTION(imagesetbrush);
|
|
|
|
PHP_FUNCTION(imagesettile);
|
|
|
|
PHP_FUNCTION(imagesetstyle);
|
|
|
|
|
2000-11-03 19:53:42 +00:00
|
|
|
PHP_FUNCTION(imagecreatefromstring);
|
2000-05-14 15:25:13 +00:00
|
|
|
PHP_FUNCTION(imagecreatefromgif);
|
|
|
|
PHP_FUNCTION(imagecreatefromjpeg);
|
2000-06-07 00:37:49 +00:00
|
|
|
PHP_FUNCTION(imagecreatefromxbm);
|
2001-05-29 07:46:07 +00:00
|
|
|
PHP_FUNCTION(imagecreatefrompng);
|
|
|
|
PHP_FUNCTION(imagecreatefromwbmp);
|
|
|
|
PHP_FUNCTION(imagecreatefromgd);
|
|
|
|
PHP_FUNCTION(imagecreatefromgd2);
|
|
|
|
PHP_FUNCTION(imagecreatefromgd2part);
|
2002-12-11 22:25:23 +00:00
|
|
|
#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
|
|
|
|
PHP_FUNCTION(imagecreatefromxpm);
|
|
|
|
#endif
|
2001-05-29 07:46:07 +00:00
|
|
|
|
2000-05-14 15:25:13 +00:00
|
|
|
PHP_FUNCTION(imagegammacorrect);
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagedestroy);
|
|
|
|
PHP_FUNCTION(imagefill);
|
|
|
|
PHP_FUNCTION(imagefilledpolygon);
|
|
|
|
PHP_FUNCTION(imagefilledrectangle);
|
|
|
|
PHP_FUNCTION(imagefilltoborder);
|
|
|
|
PHP_FUNCTION(imagefontwidth);
|
|
|
|
PHP_FUNCTION(imagefontheight);
|
2001-05-29 07:46:07 +00:00
|
|
|
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagegif );
|
2000-03-13 05:58:50 +00:00
|
|
|
PHP_FUNCTION(imagejpeg );
|
2001-05-29 07:46:07 +00:00
|
|
|
PHP_FUNCTION(imagepng);
|
|
|
|
PHP_FUNCTION(imagewbmp);
|
|
|
|
PHP_FUNCTION(imagegd);
|
|
|
|
PHP_FUNCTION(imagegd2);
|
|
|
|
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imageinterlace);
|
|
|
|
PHP_FUNCTION(imageline);
|
|
|
|
PHP_FUNCTION(imageloadfont);
|
|
|
|
PHP_FUNCTION(imagepolygon);
|
|
|
|
PHP_FUNCTION(imagerectangle);
|
|
|
|
PHP_FUNCTION(imagesetpixel);
|
|
|
|
PHP_FUNCTION(imagestring);
|
|
|
|
PHP_FUNCTION(imagestringup);
|
1999-07-27 19:44:46 +00:00
|
|
|
PHP_FUNCTION(imagesx);
|
|
|
|
PHP_FUNCTION(imagesy);
|
1999-05-21 10:06:25 +00:00
|
|
|
PHP_FUNCTION(imagedashedline);
|
|
|
|
PHP_FUNCTION(imagettfbbox);
|
|
|
|
PHP_FUNCTION(imagettftext);
|
2000-05-02 14:10:51 +00:00
|
|
|
PHP_FUNCTION(imagepsloadfont);
|
|
|
|
/*
|
|
|
|
PHP_FUNCTION(imagepscopyfont);
|
|
|
|
*/
|
|
|
|
PHP_FUNCTION(imagepsfreefont);
|
|
|
|
PHP_FUNCTION(imagepsencodefont);
|
|
|
|
PHP_FUNCTION(imagepsextendfont);
|
|
|
|
PHP_FUNCTION(imagepsslantfont);
|
|
|
|
PHP_FUNCTION(imagepstext);
|
|
|
|
PHP_FUNCTION(imagepsbbox);
|
2000-02-28 16:52:03 +00:00
|
|
|
|
2001-01-24 09:24:26 +00:00
|
|
|
PHP_FUNCTION(jpeg2wbmp);
|
|
|
|
PHP_FUNCTION(png2wbmp);
|
|
|
|
PHP_FUNCTION(image2wbmp);
|
|
|
|
|
2002-08-22 07:28:26 +00:00
|
|
|
#if HAVE_GD_BUNDLED
|
|
|
|
PHP_FUNCTION(imagelayereffect);
|
|
|
|
PHP_FUNCTION(imagecolormatch);
|
2002-11-13 20:02:58 +00:00
|
|
|
PHP_FUNCTION(imagefilter);
|
2005-04-16 12:12:24 +00:00
|
|
|
PHP_FUNCTION(imageconvolution);
|
2003-06-15 20:00:08 +00:00
|
|
|
PHP_FUNCTION(imagexbm);
|
2002-08-22 07:28:26 +00:00
|
|
|
#endif
|
|
|
|
|
2001-05-16 23:11:33 +00:00
|
|
|
PHP_GD_API int phpi_get_le_gd(void);
|
2000-11-28 08:06:30 +00:00
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
#else
|
|
|
|
|
1999-05-03 11:11:23 +00:00
|
|
|
#define phpext_gd_ptr NULL
|
1999-04-17 00:37:12 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#endif /* PHP_GD_H */
|