Файл: vendor/intervention/image/src/Drivers/Imagick/Modifiers/DrawPixelModifier.php
Строк: 35
<?php
declare(strict_types=1);
namespace InterventionImageDriversImagickModifiers;
use ImagickDraw;
use InterventionImageInterfacesImageInterface;
use InterventionImageInterfacesSpecializedInterface;
use InterventionImageModifiersDrawPixelModifier as GenericDrawPixelModifier;
class DrawPixelModifier extends GenericDrawPixelModifier implements SpecializedInterface
{
public function apply(ImageInterface $image): ImageInterface
{
$color = $this->driver()->colorProcessor($image->colorspace())->colorToNative(
$this->driver()->handleInput($this->color)
);
$pixel = new ImagickDraw();
$pixel->setFillColor($color);
$pixel->point($this->position->x(), $this->position->y());
foreach ($image as $frame) {
$frame->native()->drawImage($pixel);
}
return $image;
}
}