Вход Регистрация
Файл: vendor/intervention/image/src/Drivers/Gd/Modifiers/DrawLineModifier.php
Строк: 48
<?php

declare(strict_types=1);

namespace 
InterventionImageDriversGdModifiers;

use 
RuntimeException;
use 
InterventionImageInterfacesImageInterface;
use 
InterventionImageInterfacesSpecializedInterface;
use 
InterventionImageModifiersDrawLineModifier as GenericDrawLineModifier;

class 
DrawLineModifier extends GenericDrawLineModifier implements SpecializedInterface
{
    
/**
     * @throws RuntimeException
     */
    
public function apply(ImageInterface $image): ImageInterface
    
{
        
$color $this->driver()->colorProcessor($image->colorspace())->colorToNative(
            
$this->backgroundColor()
        );

        foreach (
$image as $frame) {
            
imagealphablending($frame->native(), true);
            
imageantialias($frame->native(), true);
            
imagesetthickness($frame->native(), $this->drawable->width());
            
imageline(
                
$frame->native(),
                
$this->drawable->start()->x(),
                
$this->drawable->start()->y(),
                
$this->drawable->end()->x(),
                
$this->drawable->end()->y(),
                
$color
            
);
        }

        return 
$image;
    }
}
Онлайн: 2
Реклама