(PECL imagick 2, PECL imagick 3)
ImagickPixelIterator::resetIterator — Resets the pixel iterator
This function is currently not documented; only its argument list is available.
Resets the pixel iterator. Use it in conjunction with ImagickPixelIterator::getNextIteratorRow() to iterate over all the pixels in a pixel container.
Returns true
on success.
Example #1 ImagickPixelIterator::resetIterator()
<?php
function resetIterator($imagePath) {
$imagick = new \Imagick(realpath($imagePath));
$imageIterator = $imagick->getPixelIterator();
foreach ($imageIterator as $pixels) {
foreach ($pixels as $column => $pixel) {
if ($column % 2) {
$pixel->setColorValue(\Imagick::COLOR_RED, 64);
}
}
$imageIterator->syncIterator();
}
$imageIterator->resetiterator();
foreach ($imageIterator as $pixels) {
foreach ($pixels as $column => $pixel) {
if ($column % 3) {
$pixel->setColorValue(\Imagick::COLOR_BLUE, 64);