1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-11 08:24:02 +02:00

Add docblock

This commit is contained in:
Oliver Vogel
2023-11-11 09:32:57 +01:00
parent bb2772041a
commit 43f34a08be
2 changed files with 19 additions and 0 deletions

View File

@@ -63,6 +63,11 @@ class Factory implements FactoryInterface
return new Image($frames); return new Image($frames);
} }
/**
* {@inheritdoc}
*
* @see FactoryInterface::newCore()
*/
public function newCore(int $width, int $height, ?ColorInterface $background = null) public function newCore(int $width, int $height, ?ColorInterface $background = null)
{ {
$core = imagecreatetruecolor($width, $height); $core = imagecreatetruecolor($width, $height);

View File

@@ -7,12 +7,15 @@ use Intervention\Image\Colors\Rgb\Channels\Green;
use Intervention\Image\Colors\Rgb\Channels\Red; use Intervention\Image\Colors\Rgb\Channels\Red;
use Intervention\Image\Drivers\Abstract\Modifiers\AbstractRotateModifier; use Intervention\Image\Drivers\Abstract\Modifiers\AbstractRotateModifier;
use Intervention\Image\Drivers\Gd\Traits\CanHandleColors; use Intervention\Image\Drivers\Gd\Traits\CanHandleColors;
use Intervention\Image\Exceptions\RuntimeException;
use Intervention\Image\Exceptions\MissingDriverComponentException;
use Intervention\Image\Geometry\Rectangle; use Intervention\Image\Geometry\Rectangle;
use Intervention\Image\Interfaces\ColorInterface; use Intervention\Image\Interfaces\ColorInterface;
use Intervention\Image\Interfaces\FrameInterface; use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Interfaces\ImageInterface;
use Intervention\Image\Interfaces\ModifierInterface; use Intervention\Image\Interfaces\ModifierInterface;
use Intervention\Image\Traits\CanBuildNewImage; use Intervention\Image\Traits\CanBuildNewImage;
use ReflectionException;
class RotateModifier extends AbstractRotateModifier implements ModifierInterface class RotateModifier extends AbstractRotateModifier implements ModifierInterface
{ {
@@ -30,6 +33,17 @@ class RotateModifier extends AbstractRotateModifier implements ModifierInterface
return $image; return $image;
} }
/**
* Apply rotation modification on given frame, given background
* color is used for newly create image areas
*
* @param FrameInterface $frame
* @param ColorInterface $background
* @return void
* @throws RuntimeException
* @throws MissingDriverComponentException
* @throws ReflectionException
*/
protected function modify(FrameInterface $frame, ColorInterface $background): void protected function modify(FrameInterface $frame, ColorInterface $background): void
{ {
// rotate original image against transparent background // rotate original image against transparent background