ManaPHP\Image\Adapter\Gd::rotate PHP Method

rotate() public method

Rotate the image by a given degrees
public rotate ( integer $degrees, integer $background = 16777215, float $alpha = 1 ) : static
$degrees integer
$background integer
$alpha float
return static
    public function rotate($degrees, $background = 0xffffff, $alpha = 1.0)
    {
        $transparent = imagecolorallocatealpha($this->_image, $background >> 16 & 0xff, $background >> 8 & 0xff, $background & 0xff, $alpha * 127);
        $image = imagerotate($this->_image, 360 - $degrees, $transparent, true);
        imagealphablending($image, false);
        imagesavealpha($image, true);
        imagedestroy($this->_image);
        $this->_image = $image;
        $this->_width = imagesx($image);
        $this->_height = imagesy($image);
        return $this;
    }