Файл: vendor/intervention/image/src/Drivers/Imagick/Analyzers/PixelColorAnalyzer.php
Строк: 57
<?php
declare(strict_types=1);
namespace InterventionImageDriversImagickAnalyzers;
use Imagick;
use InterventionImageAnalyzersPixelColorAnalyzer as GenericPixelColorAnalyzer;
use InterventionImageExceptionsColorException;
use InterventionImageInterfacesColorInterface;
use InterventionImageInterfacesColorspaceInterface;
use InterventionImageInterfacesImageInterface;
use InterventionImageInterfacesSpecializedInterface;
class PixelColorAnalyzer extends GenericPixelColorAnalyzer implements SpecializedInterface
{
public function analyze(ImageInterface $image): mixed
{
return $this->colorAt(
$image->colorspace(),
$image->core()->frame($this->frame_key)->native()
);
}
/**
* @throws ColorException
*/
protected function colorAt(ColorspaceInterface $colorspace, Imagick $imagick): ColorInterface
{
return $this->driver()
->colorProcessor($colorspace)
->nativeToColor(
$imagick->getImagePixelColor($this->x, $this->y)
);
}
}