This commit adds an Image interface and implementation that will be used in the Captcha generation process. The Image object includes methods for manipulating an image, such as adding text, inserting a background, and adding a line. These methods will provide the necessary functionalities for generating a Captcha.
This commit is contained in:
17
app/Captcha/Contracts/Image.php
Normal file
17
app/Captcha/Contracts/Image.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Captcha\Contracts;
|
||||
|
||||
use App\Captcha\Dto\Coordinators;
|
||||
|
||||
interface Image
|
||||
{
|
||||
public function __construct(int $width, int $height);
|
||||
public function getWidth(): int;
|
||||
public function getHeight(): int;
|
||||
public function insertBackground(string $pathToFile): self;
|
||||
public function addText(string $text, int $x, int $y, float $size, float $angle, string $hexColor, string $fontName): Coordinators;
|
||||
public function addLine(int $x1, int $y1, int $x2, int $y2, string $hexColor): self;
|
||||
public function encode(): string;
|
||||
public function __destruct();
|
||||
}
|
Reference in New Issue
Block a user