<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="imagick.getpixelregioniterator">
 <refnamediv>
  <refname>Imagick::getPixelRegionIterator</refname>
  <refpurpose>Get an ImagickPixelIterator for an image section</refpurpose>
 </refnamediv>
 
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>ImagickPixelIterator</type><methodname>Imagick::getPixelRegionIterator</methodname>
   <methodparam><type>int</type><parameter>x</parameter></methodparam>
   <methodparam><type>int</type><parameter>y</parameter></methodparam>
   <methodparam><type>int</type><parameter>columns</parameter></methodparam>
   <methodparam><type>int</type><parameter>rows</parameter></methodparam>
  </methodsynopsis>
  <para>
   Get an ImagickPixelIterator for an image section.
  </para>
 </refsect1>
 
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>x</parameter></term>
     <listitem>
      <para>
       The x-coordinate of the region.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>y</parameter></term>
     <listitem>
      <para>
       The y-coordinate of the region.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>columns</parameter></term>
     <listitem>
      <para>
       The width of the region.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>rows</parameter></term>
     <listitem>
      <para>
       The height of the region.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns an ImagickPixelIterator for an image section.
  </para>
 </refsect1>
 
 <refsect1 role="errors">
  &reftitle.errors;
  <para>
   &imagick.imagick.throws;
  </para>
 </refsect1>

 <refsect1 role="examples"><!-- {{{ -->
  &reftitle.examples;
  <para>
   <example><!-- {{{ -->
    <title><methodname>Imagick::getPixelRegionIterator</methodname> example</title>
    <para>
     Iterate over the pixels in the top left of the image, changing them to be black.
    </para>
    <programlisting role="php">
     <![CDATA[
<?php
$im = new Imagick(realpath("./testImage.png"));
$areaIterator = $im->getPixelRegionIterator(0, 0, 10, 10);

foreach ($areaIterator as $rowIterator) {
    foreach ($rowIterator as $pixel) {
        // Paint every pixel black
        $pixel->setColor("rgba(0, 0, 0, 0)");
    }
    $areaIterator->syncIterator();
}
$im->writeImage("./output.png");
?>
]]>
    </programlisting>
   </example><!-- }}} -->
  </para>
 </refsect1><!-- }}} -->
 
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
