Imbo\Image\Transformation\DrawPois::drawPoiRectangle PHP Метод

drawPoiRectangle() приватный Метод

Draw rectangle around a POI
private drawPoiRectangle ( array $poi, string $color, integer $borderSize, integer $imageWidth, integer $imageHeight )
$poi array
$color string
$borderSize integer
$imageWidth integer
$imageHeight integer
    private function drawPoiRectangle($poi, $color, $borderSize, $imageWidth, $imageHeight)
    {
        $rect = new ImagickDraw();
        $rect->setStrokeColor($color);
        $rect->setFillColor($color);
        $rect->setStrokeAntialias(false);
        $x1 = max(0, $poi['x'] - $borderSize);
        $x2 = min($imageWidth, $poi['x'] + $poi['width'] + $borderSize);
        // Left
        $rect->rectangle($x1, $poi['y'], $poi['x'], $poi['y'] + $poi['height']);
        // Right
        $rect->rectangle($poi['x'] + $poi['width'], $poi['y'], $x2, $poi['y'] + $poi['height']);
        // Top
        $rect->rectangle($x1, max(0, $poi['y'] - $borderSize), $x2, $poi['y']);
        // Bottom
        $rect->rectangle($x1, $poi['y'] + $poi['height'], $x2, min($imageHeight, $poi['y'] + $poi['height'] + $borderSize));
        // Draw the rectangle
        $this->imagick->drawImage($rect);
    }