cvs: phpdoc /en/reference/image constants.xml /en/reference/image/figures imagefilterpixelate.png /en/reference/image/functions imagefilter.xml

From: Date: Wed, 28 Jan 2009 13:20:11 +0000
Subject: cvs: phpdoc /en/reference/image constants.xml /en/reference/image/figures imagefilterpixelate.png /en/reference/image/functions imagefilter.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3101@lists.php.net to get a copy of this message
kalle Wed Jan 28 13:20:11 2009 UTC Added files: /phpdoc/en/reference/image/figures imagefilterpixelate.png Modified files: /phpdoc/en/reference/image constants.xml /phpdoc/en/reference/image/functions imagefilter.xml Log: Document image pixelation http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/image/constants.xml?r1=1.15&r2=1.16&diff_format=u Index: phpdoc/en/reference/image/constants.xml diff -u phpdoc/en/reference/image/constants.xml:1.15 phpdoc/en/reference/image/constants.xml:1.16 --- phpdoc/en/reference/image/constants.xml:1.15 Tue Jul 29 21:26:28 2008 +++ phpdoc/en/reference/image/constants.xml Wed Jan 28 13:20:10 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> +<!-- $Revision: 1.16 $ --> <appendix xml:id="image.constants" xmlns="http://docbook.org/ns/docbook"> &reftitle.constants; &extension.constants; @@ -467,6 +467,18 @@ </varlistentry> <varlistentry> <term> + <constant>IMG_FILTER_PIXELATE</constant> + (<type>integer</type>) + </term> + <listitem> + <simpara> + Special GD filter used by the <function>imagefilter</function> function. + (Available as of PHP 5.3.0) + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term> <constant>IMAGETYPE_GIF</constant> (<type>integer</type>) </term> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/image/functions/imagefilter.xml?r1=1.13&r2=1.14&diff_format=u Index: phpdoc/en/reference/image/functions/imagefilter.xml diff -u phpdoc/en/reference/image/functions/imagefilter.xml:1.13 phpdoc/en/reference/image/functions/imagefilter.xml:1.14 --- phpdoc/en/reference/image/functions/imagefilter.xml:1.13 Mon Sep 8 12:02:19 2008 +++ phpdoc/en/reference/image/functions/imagefilter.xml Wed Jan 28 13:20:10 2009 @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <refentry xml:id="function.imagefilter" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>imagefilter</refname> @@ -132,6 +132,11 @@ <constant>IMG_FILTER_SMOOTH</constant>: Smoothness level. </simpara> </listitem> + <listitem> + <simpara> + <constant>IMG_FILTER_PIXELATE</constant>: Block size in pixels. + </simpara> + </listitem> </itemizedlist> </para> </listitem> @@ -146,6 +151,12 @@ <constant>IMG_FILTER_COLORIZE</constant>: Value of green component. </simpara> </listitem> + <listitem> + <simpara> + <constant>IMG_FILTER_PIXELATE</constant>: Whether to use advanced pixelation + effect or not (defaults to &false;). + </simpara> + </listitem> </itemizedlist> </para> </listitem> @@ -202,6 +213,12 @@ </thead> <tbody> <row> + <entry>5.3.0</entry> + <entry> + Pixelation support (<constant>IMG_FILTER_PIXELATE</constant>) was added. + </entry> + </row> + <row> <entry>5.2.5</entry> <entry> Alpha support for <constant>IMG_FILTER_COLORIZE</constant> was added. @@ -238,6 +255,8 @@ ]]> </programlisting> </example> + </para> + <para> <example> <title><function>imagefilter</function> brightness example</title> <programlisting role="php"> @@ -260,6 +279,8 @@ ]]> </programlisting> </example> + </para> + <para> <example> <title><function>imagefilter</function> colorize example</title> <programlisting role="php"> @@ -283,6 +304,8 @@ ]]> </programlisting> </example> + </para> + <para> <example> <title><function>imagefilter</function> negate example</title> <programlisting role="php"> @@ -330,6 +353,47 @@ </programlisting> </example> </para> + <para> + <example> + <title><function>imagefilter</function> pixelate example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Load the PHP logo, we need to create two instances +// to show the differences +$logo1 = imagecreatefrompng('./php.png'); +$logo2 = imagecreatefrompng('./php.png'); + +// Create the image instance we want to show the +// differences on +$output = imagecreatetruecolor(imagesx($logo1) * 2, imagesy($logo1)); + +// Apply pixelation to each instance, with a block +// size of 3 +imagefilter($logo1, IMG_FILTER_PIXELATE, 3); +imagefilter($logo2, IMG_FILTER_PIXELATE, 3, true); + +// Merge the differences onto the output image +imagecopy($output, $logo1, 0, 0, 0, 0, imagesx($logo1) - 1, imagesy($logo1) - 1); +imagecopy($output, $logo2, imagesx($logo2), 0, 0, 0, imagesx($logo2) - 1, imagesy($logo2) - 1); +imagedestroy($logo1); +imagedestroy($logo2); + +// Output the differences +header('Content-Type: image/png'); +imagepng($output); +imagedestroy($output); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.imagefilterpixelate.png"/> + </imageobject> + </mediaobject> + </example> + </para> </refsect1> <refsect1 role="notes"> &reftitle.notes;

« previous php.doc.cvs (#3101) next »