ImageMagick ImagickPixelIterator::setIteratorRow
(PECL imagick 2, PECL imagick 3)
ImagickPixelIterator::setIteratorRow — 픽셀 반복기 행 설정
설명
public ImagickPixelIterator::setIteratorRow(int $row
): bool
경고 이 함수는 현재 문서화되어 있지 않습니다. 해당 인수 목록만 사용할 수 있습니다.
픽셀 반복기 행을 설정합니다.
매개변수
row
반환 값
성공하면 true
를 반환합니다.
Examples
예제 #1 ImagickPixelIterator::setIteratorRow()
<?php
function setIteratorRow($imagePath) {
$imagick = new \Imagick(realpath($imagePath));
$imageIterator = $imagick->getPixelRegionIterator(200, 100, 200, 200);
for ($x = 0; $x < 20; $x++) {
$imageIterator->setIteratorRow($x * 5);
$pixels = $imageIterator->getCurrentIteratorRow();
/* Loop through the pixels in the row (columns) */
foreach ($pixels as $pixel) {
/** @var $pixel \ImagickPixel */
/* Paint every second pixel black*/
$pixel->setColor("rgba(0, 0, 0, 0)");
}
/* Sync the iterator, this is important to do on each iteration */
$imageIterator->syncIterator();
}
header("Content-Type: image/jpg");
echo $imagick;
}
?>