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

declare(strict_types=1);

namespace 
InterventionImageDriversGdModifiers;

use 
InterventionImageInterfacesImageInterface;
use 
InterventionImageInterfacesSpecializedInterface;
use 
InterventionImageModifiersDrawPixelModifier as GenericDrawPixelModifier;

class 
DrawPixelModifier extends GenericDrawPixelModifier implements SpecializedInterface
{
    
/**
     * {@inheritdoc}
     *
     * @see ModifierInterface::apply()
     */
    
public function apply(ImageInterface $image): ImageInterface
    
{
        
$color $this->driver()->colorProcessor($image->colorspace())->colorToNative(
            
$this->driver()->handleInput($this->color)
        );

        foreach (
$image as $frame) {
            
imagealphablending($frame->native(), true);
            
imagesetpixel(
                
$frame->native(),
                
$this->position->x(),
                
$this->position->y(),
                
$color
            
);
        }

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