File "PixelCommand.php"
Full Path: /home/clickysoft/public_html/jmapi5.clickysoft.net/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/PixelCommand.php
File size: 819 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
namespace Intervention\Image\Imagick\Commands;
use Intervention\Image\Commands\AbstractCommand;
use Intervention\Image\Imagick\Color;
class PixelCommand extends AbstractCommand
{
/**
* Draws one pixel to a given image
*
* @param \Intervention\Image\Image $image
* @return boolean
*/
public function execute($image)
{
$color = $this->argument(0)->required()->value();
$color = new Color($color);
$x = $this->argument(1)->type('digit')->required()->value();
$y = $this->argument(2)->type('digit')->required()->value();
// prepare pixel
$draw = new \ImagickDraw;
$draw->setFillColor($color->getPixel());
$draw->point($x, $y);
// apply pixel
return $image->getCore()->drawImage($draw);
}
}