File indexing completed on 2025-01-26 05:29:14

0001 <?php
0002 
0003 namespace Intervention\Image\Gd\Commands;
0004 
0005 use Intervention\Image\Gd\Color;
0006 
0007 class PixelCommand extends \Intervention\Image\Commands\AbstractCommand
0008 {
0009     /**
0010      * Draws one pixel to a given image
0011      *
0012      * @param  \Intervention\Image\Image $image
0013      * @return boolean
0014      */
0015     public function execute($image)
0016     {
0017         $color = $this->argument(0)->required()->value();
0018         $color = new Color($color);
0019         $x = $this->argument(1)->type('digit')->required()->value();
0020         $y = $this->argument(2)->type('digit')->required()->value();
0021 
0022         return imagesetpixel($image->getCore(), $x, $y, $color->getInt());
0023     }
0024 }