1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-26 23:35:12 +02:00

Add image method

This commit is contained in:
Oliver Vogel
2023-11-26 11:26:55 +01:00
parent 54c9518fc1
commit 7c1e07db06
2 changed files with 7 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ use Intervention\Image\Interfaces\ResolutionInterface;
use Intervention\Image\Interfaces\SizeInterface;
use Intervention\Image\Modifiers\GreyscaleModifier;
use Intervention\Image\Modifiers\PixelateModifier;
use Intervention\Image\Modifiers\RotateModifier;
use Intervention\Image\Modifiers\SharpenModifier;
use Intervention\Image\Modifiers\TextModifier;
use Intervention\Image\Typography\FontFactory;
@@ -146,6 +147,11 @@ class Image implements ImageInterface, Countable
return $this->modify(new GreyscaleModifier());
}
public function rotate(float $angle, mixed $background = 'ffffff'): ImageInterface
{
return $this->modify(new RotateModifier($angle, $background));
}
public function text(string $text, int $x, int $y, callable|FontInterface $font): ImageInterface
{
return $this->modify(

View File

@@ -27,5 +27,6 @@ interface ImageInterface extends IteratorAggregate, Countable
public function sharpen(int $amount = 10): ImageInterface;
public function greyscale(): ImageInterface;
public function pixelate(int $size): ImageInterface;
public function rotate(float $angle, mixed $background = 'ffffff'): ImageInterface;
public function text(string $text, int $x, int $y, callable|FontInterface $font): ImageInterface;
}