wez Fri Apr 13 17:16:21 2001 EDT
Modified files:
/phpdoc/en/functions image.xml
Log:
New GD 2.0 support documented, plus some other older functions.
Index: phpdoc/en/functions/image.xml
diff -u phpdoc/en/functions/image.xml:1.33 phpdoc/en/functions/image.xml:1.34
--- phpdoc/en/functions/image.xml:1.33 Tue Jan 23 16:07:58 2001
+++ phpdoc/en/functions/image.xml Fri Apr 13 17:16:21 2001
@@ -116,6 +116,39 @@
</refsect1>
</refentry>
+ <refentry id="function.imagealphablending">
+ <refnamediv>
+ <refname>ImageAlphaBlending</refname>
+ <refpurpose>Set the blending mode for an image</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imagealphablending</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ <paramdef>bool <parameter>blendmode</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageAlphaBlending</function> allows for two different
+ modes of drawing on truecolor images. In blending mode, the
+ alpha channel component of the color supplied to all drawing function,
+ such as <function>ImageSetPixel</function> determines how much of the
+ underlying color shouldbe allowed to shine through. As a result, gd
+ automatically blends the existing color at that point with the drawing color,
+ and stores the result in the image. The resulting pixel is opaque. In
+ non-blending mode, the drawing color is copied literally with its alpha
+channel
+ information, replacing the destination pixel. Blending mode is not available
+ when drawing on palette images.
+ If <parameter>blendmode</parameter> is true, then blending mode is enabled,
+otherwise
+ disabled.
+ </para>
+ <note><para>This function was added in PHP 4.0.6 and requires GD
+2.0.1</para></note>
+ </refsect1>
+ </refentry>
+
+
<refentry id="function.imagearc">
<refnamediv>
<refname>ImageArc</refname>
@@ -148,6 +181,117 @@
</refsect1>
</refentry>
+ <refentry id="function.imagefilledarc">
+ <refnamediv>
+ <refname>ImageArc</refname>
+ <refpurpose>Draw a partial ellipse and fill it</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imagefilledarc</function></funcdef>
+ <paramdef>int <parameter>im</parameter></paramdef>
+ <paramdef>int <parameter>cx</parameter></paramdef>
+ <paramdef>int <parameter>cy</parameter></paramdef>
+ <paramdef>int <parameter>w</parameter></paramdef>
+ <paramdef>int <parameter>h</parameter></paramdef>
+ <paramdef>int <parameter>s</parameter></paramdef>
+ <paramdef>int <parameter>e</parameter></paramdef>
+ <paramdef>int <parameter>col</parameter></paramdef>
+ <paramdef>int <parameter>style</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageFilledArc</function> draws a partial ellipse centered at
+ <parameter>cx</parameter>, <parameter>cy</parameter> (top left is
+ 0, 0) in the image represented by im. <parameter>W</parameter>
+ and <parameter>h</parameter> specifies the ellipse's width and
+ height respectively while the start and end points are specified
+ in degrees indicated by the <parameter>s</parameter> and
+ <parameter>e</parameter>. arguments.
+ <parameter>style</parameter> is a bitwise OR of the following possibilities:
+ <orderedlist>
+ <listitem><simpara>IMG_ARC_PIE</simpara></listitem>
+ <listitem><simpara>IMG_ARC_CHORD</simpara></listitem>
+ <listitem><simpara>IMG_ARC_NOFILL</simpara></listitem>
+ <listitem><simpara>IMG_ARC_EDGED</simpara></listitem>
+ </orderedlist>
+ IMG_ARC_PIE and IMG_ARC_CHORD are mutually exclusive; IMG_ARC_CHORD just
+ connects the starting and ending angles with a straight line, while
+ IMG_ARC_PIE produces a rounded edge. IMG_ARC_NOFILL indicates that the arc
+ or chord should be outlined, not filled. IMG_ARC_EDGED, used together with
+ IMG_ARC_NOFILL, indicates that the beginning and ending angles should be
+ connected to the center - this is a good way to outline (rather than fill)
+ a 'pie slice'.
+ </para>
+ <note><para>This function was added in PHP 4.0.6 and requires GD
+2.0.1</para></note>
+ </refsect1>
+ </refentry>
+
+
+
+ <refentry id="function.imageellipse">
+ <refnamediv>
+ <refname>ImageEllipse</refname>
+ <refpurpose>Draw an ellipse</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imageellipse</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ <paramdef>int <parameter>cx</parameter></paramdef>
+ <paramdef>int <parameter>cy</parameter></paramdef>
+ <paramdef>int <parameter>w</parameter></paramdef>
+ <paramdef>int <parameter>h</parameter></paramdef>
+ <paramdef>int <parameter>col</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageEllipse</function> draws an ellipse centered at
+ <parameter>cx</parameter>, <parameter>cy</parameter> (top left is
+ 0, 0) in the image represented by <parameter>im</parameter>.
+ <parameter>W</parameter> and <parameter>h</parameter> specifies the
+ ellipse's width and height respectively. The color of the ellipse is
+ specified by <parameter>color</parameter>.
+ </para>
+ <note><para>This function was added in PHP 4.0.6 and requires GD 2.0.2 or
+later</para></note>
+ </refsect1>
+ </refentry>
+
+
+ <refentry id="function.imagefilledellipse">
+ <refnamediv>
+ <refname>ImageFilledEllipse</refname>
+ <refpurpose>Draw a filled ellipse</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imagefilledellipse</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ <paramdef>int <parameter>cx</parameter></paramdef>
+ <paramdef>int <parameter>cy</parameter></paramdef>
+ <paramdef>int <parameter>w</parameter></paramdef>
+ <paramdef>int <parameter>h</parameter></paramdef>
+ <paramdef>int <parameter>col</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageFilledEllipse</function> draws an ellipse centered at
+ <parameter>cx</parameter>, <parameter>cy</parameter> (top left is
+ 0, 0) in the image represented by <parameter>im</parameter>.
+ <parameter>W</parameter> and <parameter>h</parameter> specifies the
+ ellipse's width and height respectively. The ellipse is filled using
+ <parameter>color</parameter>
+ </para>
+ <note><para>This function was added in PHP 4.0.6 and requires GD 2.0.1 or
+later</para></note>
+ </refsect1>
+ </refentry>
+
<refentry id="function.imagechar">
<refnamediv>
<refname>ImageChar</refname>
@@ -342,6 +486,38 @@
</refsect1>
</refentry>
+ <refentry id="function.imagecolorclosestalpha">
+ <refnamediv>
+ <refname>ImageColorClosestAlpha</refname>
+ <refpurpose>
+ Get the index of the closest color to the specified color + alpha
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imagecolorclosestalpha</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ <paramdef>int <parameter>red</parameter></paramdef>
+ <paramdef>int <parameter>green</parameter></paramdef>
+ <paramdef>int <parameter>blue</parameter></paramdef>
+ <paramdef>int <parameter>alpha</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ Returns the index of the color in the palette of the image which
+ is "closest" to the specified <acronym>RGB</acronym> value and
+<parameter>alpha</parameter> level.
+ </para>
+ <para>
+ See also <function>imagecolorexactalpha</function>.
+ </para>
+ <note><para>This function was added in PHP 4.0.6 and requires GD
+2.0.1</para></note>
+ </refsect1>
+ </refentry>
+
+
+
<refentry id="function.imagecolorexact">
<refnamediv>
<refname>ImageColorExact</refname>
@@ -372,6 +548,39 @@
</refsect1>
</refentry>
+ <refentry id="function.imagecolorexactalpha">
+ <refnamediv>
+ <refname>ImageColorExactAlpha</refname>
+ <refpurpose>Get the index of the specified color + alpha</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imagecolorexactalpha</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ <paramdef>int <parameter>red</parameter></paramdef>
+ <paramdef>int <parameter>green</parameter></paramdef>
+ <paramdef>int <parameter>blue</parameter></paramdef>
+ <paramdef>int <parameter>alpha</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ Returns the index of the specified color+alpha in the palette of the
+ image.
+ </para>
+ <para>
+ If the color does not exist in the image's palette, -1 is
+ returned.
+ </para>
+ <para>
+ See also <function>imagecolorclosestalpha</function>.
+ </para>
+ <note><para>This function was added in PHP 4.0.6 and requires GD 2.0.1 or
+later</para></note>
+ </refsect1>
+ </refentry>
+
+
<refentry id="function.imagecolorresolve">
<refnamediv>
<refname>ImageColorResolve</refname>
@@ -402,6 +611,40 @@
</refsect1>
</refentry>
+ <refentry id="function.imagecolorresolvealpha">
+ <refnamediv>
+ <refname>ImageColorResolveAlpha</refname>
+ <refpurpose>
+ Get the index of the specified color + alpha or its closest possible
+ alternative
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imagecolorresolvealpha</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ <paramdef>int <parameter>red</parameter></paramdef>
+ <paramdef>int <parameter>green</parameter></paramdef>
+ <paramdef>int <parameter>blue</parameter></paramdef>
+ <paramdef>int <parameter>alpha</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function is guaranteed to return a color index for a
+ requested color, either the exact color or the closest possible
+ alternative.
+ </para>
+ <para>
+ See also <function>imagecolorclosestalpha</function>.
+ </para>
+ <note><para>This function was added in PHP 4.0.6 and requires GD
+2.0.1</para></note>
+ </refsect1>
+ </refentry>
+
+
+
<refentry id="function.imagegammacorrect">
<refnamediv>
<refname>ImageGammaCorrect</refname>
@@ -603,6 +846,95 @@
</refsect1>
</refentry>
+ <refentry id="function.imagecopymerge">
+ <refnamediv>
+ <refname>ImageCopyMerge</refname>
+ <refpurpose>
+ Copy and merge part of an image
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>ImageCopyMerge</function> </funcdef>
+ <paramdef>int <parameter>dst_im</parameter> </paramdef>
+ <paramdef>int <parameter>src_im</parameter> </paramdef>
+ <paramdef>int <parameter>dst_x</parameter> </paramdef>
+ <paramdef>int <parameter>dst_y</parameter> </paramdef>
+ <paramdef>int <parameter>src_x</parameter> </paramdef>
+ <paramdef>int <parameter>src_y</parameter> </paramdef>
+ <paramdef>int <parameter>src_w</parameter> </paramdef>
+ <paramdef>int <parameter>src_h</parameter> </paramdef>
+ <paramdef>int <parameter>pct</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ Copy a part of <parameter>src_im</parameter> onto
+ <parameter>dst_im</parameter> starting at the x,y coordinates
+ <parameter>src_x</parameter>, <parameter>src_y </parameter> with
+ a width of <parameter>src_w</parameter> and a height of
+ <parameter>src_h</parameter>. The portion defined will be copied
+ onto the x,y coordinates, <parameter>dst_x</parameter> and
+ <parameter>dst_y</parameter>.
+ The two images will be merged according to <parameter>pct</parameter>
+ which can range from 0 to 100. When <parameter>pct</parameter> = 0,
+ no action is taken, when 100 this function behaves identically
+ to <function>ImageCopy</function>.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.imagecopymergegray">
+ <refnamediv>
+ <refname>ImageCopyMergeGray</refname>
+ <refpurpose>
+ Copy and merge part of an image with gray scale
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>ImageCopyMergeGray</function> </funcdef>
+ <paramdef>int <parameter>dst_im</parameter> </paramdef>
+ <paramdef>int <parameter>src_im</parameter> </paramdef>
+ <paramdef>int <parameter>dst_x</parameter> </paramdef>
+ <paramdef>int <parameter>dst_y</parameter> </paramdef>
+ <paramdef>int <parameter>src_x</parameter> </paramdef>
+ <paramdef>int <parameter>src_y</parameter> </paramdef>
+ <paramdef>int <parameter>src_w</parameter> </paramdef>
+ <paramdef>int <parameter>src_h</parameter> </paramdef>
+ <paramdef>int <parameter>pct</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ This function is identical to <function>ImageCopyMerge</function> except
+ that when merging it preservese the hue of the source by converting
+ the destination pixels to gray scale before the copy operation.
+ </para>
+ <para>
+ Copy a part of <parameter>src_im</parameter> onto
+ <parameter>dst_im</parameter> starting at the x,y coordinates
+ <parameter>src_x</parameter>, <parameter>src_y </parameter> with
+ a width of <parameter>src_w</parameter> and a height of
+ <parameter>src_h</parameter>. The portion defined will be copied
+ onto the x,y coordinates, <parameter>dst_x</parameter> and
+ <parameter>dst_y</parameter>.
+ The two images will be merged according to <parameter>pct</parameter>
+ which can range from 0 to 100. When <parameter>pct</parameter> = 0,
+ no action is taken, when 100 this function behaves identically
+ to <function>ImageCopy</function>.
+ </para>
+ <para>
+ This function is identical to <function>ImageCopyMerge</function> except
+ that when merging it preservese the hue of the source by converting
+ the destination pixels to gray scale before the copy operation.
+ </para>
+ <note><para>This function was added in PHP 4.0.6</para></note>
+ </refsect1>
+ </refentry>
+
<refentry id="function.imagecopyresized">
<refnamediv>
<refname>ImageCopyResized</refname>
@@ -638,13 +970,62 @@
<parameter>src_im</parameter>) but if the regions overlap the
results will be unpredictable.
</para>
+ <para>
+ See also <function>ImageCopyResampled</function>.
+ </para>
</refsect1>
</refentry>
+ <refentry id="function.imagecopyresampled">
+ <refnamediv>
+ <refname>ImageCopyResampled</refname>
+ <refpurpose>Copy and resize part of an image with resampling</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imagecopyresampled</function></funcdef>
+ <paramdef>resource <parameter>dst_im</parameter></paramdef>
+ <paramdef>resource <parameter>src_im</parameter></paramdef>
+ <paramdef>int <parameter>dstX</parameter></paramdef>
+ <paramdef>int <parameter>dstY</parameter></paramdef>
+ <paramdef>int <parameter>srcX</parameter></paramdef>
+ <paramdef>int <parameter>srcY</parameter></paramdef>
+ <paramdef>int <parameter>dstW</parameter></paramdef>
+ <paramdef>int <parameter>dstH</parameter></paramdef>
+ <paramdef>int <parameter>srcW</parameter></paramdef>
+ <paramdef>int <parameter>srcH</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageCopyResampled</function> copies a rectangular
+ portion of one image to another image, smoothly interpolating pixel
+ values so that, in particular, reducing the size of an image still
+ retains a great deal of clarity.
+ <parameter>Dst_im</parameter> is the destination image,
+ <parameter>src_im</parameter> is the source image identifier. If
+ the source and destination coordinates and width and heights
+ differ, appropriate stretching or shrinking of the image fragment
+ will be performed. The coordinates refer to the upper left
+ corner. This function can be used to copy regions within the
+ same image (if <parameter>dst_im</parameter> is the same as
+ <parameter>src_im</parameter>) but if the regions overlap the
+ results will be unpredictable.
+ </para>
+ <para>
+ See also <function>ImageCopyResized</function>.
+ </para>
+ <note><para>This function was added in PHP 4.0.6 and requires GD 2.0.1 or
+later</para></note>
+ </refsect1>
+ </refentry>
+
+
+
<refentry id="function.imagecreate">
<refnamediv>
<refname>ImageCreate</refname>
- <refpurpose>Create a new image</refpurpose>
+ <refpurpose>Create a new palette based image</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@@ -679,6 +1060,58 @@
</refsect1>
</refentry>
+ <refentry id="function.imagecreatetruecolor">
+ <refnamediv>
+ <refname>ImageCreateTrueColor</refname>
+ <refpurpose>Create a new true color image</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>resource <function>imagecreatetruecolor</function></funcdef>
+ <paramdef>int <parameter>x_size</parameter></paramdef>
+ <paramdef>int <parameter>y_size</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageCreateTrueColor</function> returns an image identifier
+ representing a black image of size <parameter>x_size</parameter>
+ by <parameter>y_size</parameter>.
+ </para>
+ <note><para>This function was added in PHP 4.0.6</para></note>
+ <note><para>This function requires GD 2.0.1 or later</para></note>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.imagetruecolortopalette">
+ <refnamediv>
+ <refname>ImageTrueColorToPalette</refname>
+ <refpurpose>Convert a true color image to a palette image</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>void <function>imagetruecolortopalette</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageTrueColorToPalette</function> converts a truecolor image
+ to a palette image. The code for this function was originally drawn from
+ the Independent JPEG Group library code, which is excellent. The code
+ has been modified to preserve as much alpha channel information as
+ possible in the resulting palette, in addition to preserving colors as
+ well as possible. This does not work as well as might be hoped. It is
+ usually best to simply produce a truecolor output image instead, which
+ guarantees the highest output quality.
+ </para>
+ <note><para>This function was added in PHP 4.0.6</para></note>
+ <note><para>This function requires GD 2.0.1 or later</para></note>
+ </refsect1>
+ </refentry>
+
<refentry id="function.imagecreatefromgif">
<refnamediv>
<refname>ImageCreateFromGIF</refname>
@@ -1934,6 +2367,97 @@
</para>
</refsect1>
</refentry>
+
+ <refentry id="function.imagesetbrush">
+ <refnamediv>
+ <refname>ImageSetTile</refname>
+ <refpurpose>Set the brush image for line drawing</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imagesetbrush</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ <paramdef>resource <parameter>brush</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageSetBrush</function> sets the brush image to be
+ used by all line drawing functions (such as <function>ImageLine</function>
+ and <function>ImagePolygon</function>) when drawing with the special
+ colors IMG_COLOR_BRUSHED or IMG_COLOR_STYLEDBRUSHED.
+ </para>
+ <note>
+ <para>You need not take special action when you are finished with a brush,
+but if you
+ destroy the brush image, you must not use the IMG_COLOR_BRUSHED or
+IMG_COLOR_STYLEDBRUSHED
+ colors until you have set a new brush image!</para>
+ </note>
+ <note><para>This function was added in PHP 4.0.6</para></note>
+ </refsect1>
+ </refentry>
+
+
+ <refentry id="function.imagesettile">
+ <refnamediv>
+ <refname>ImageSetTile</refname>
+ <refpurpose>Set the tile image for filling</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>int <function>imagesettile</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ <paramdef>resource <parameter>tile</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageSetTile</function> sets the tile image to be
+ used by all region filling functions (such as <function>ImageFill</function>
+ and <function>ImageFilledPolygon</function>) when filling with the special
+ color IMG_COLOR_TILED.
+ </para>
+ <para>
+ A tile is an image used to fill an area with a repeated pattern.
+<emphasis>Any</emphasis>
+ GD image can be used as a tile, and by setting the transparent color index
+of the tile
+ image with <function>ImageColorTransparent</function>, a tile allows certain
+parts
+ of the underlying area to shine through can be created.
+ </para>
+ <note>
+ <para>You need not take special action when you are finished with a tile,
+but if you
+ destroy the tile image, you must not use the IMG_COLOR_TILED color until you
+have
+ set a new tile image!</para>
+ </note>
+ <note><para>This function was added in PHP 4.0.6</para></note>
+ </refsect1>
+ </refentry>
+
+
+
+ <refentry id="function.imagesetthickness">
+ <refnamediv>
+ <refname>ImageSetThickness</refname>
+ <refpurpose>Set the thickness for line drawing</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>void <function>imagesetthickness</function></funcdef>
+ <paramdef>resource <parameter>im</parameter></paramdef>
+ <paramdef>int <parameter>thickness</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ <function>ImageSetThickness</function> sets the thickness of the lines
+ drawn when drawing rectangles, polygons, ellipses etc. etc. to
+ <parameter>thickness</parameter> pixels.
+ </para>
+ <note><para>This function was added in PHP 4.0.6 and requires GD 2.0.1 or
+later</para></note>
+ </refsect1>
+ </refentry>
+
<refentry id="function.imagestring">
<refnamediv>