Skip to content

Commit

Permalink
Add doc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Sep 29, 2023
1 parent 834d5cb commit af9fea0
Showing 1 changed file with 115 additions and 1 deletion.
116 changes: 115 additions & 1 deletion src/Interfaces/ImageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,51 @@ interface ImageInterface extends Traversable, Countable
* @return null|FrameInterface
*/
public function getFrame(int $position = 0): ?FrameInterface;

/**
* Add frame to animated image
*
* @param FrameInterface $frame
* @return ImageInterface
*/
public function addFrame(FrameInterface $frame): ImageInterface;

/**
* Set loop count of animated image
*
* @param int $count
* @return ImageInterface
*/
public function setLoops(int $count): ImageInterface;

/**
* Return loop count of animated image
*
* @return int
*/
public function getLoops(): int;

/**
* Return size of current image
*
* @return SizeInterface
*/
public function getSize(): SizeInterface;

/**
* Determine if current image is animated
*
* @return bool
*/
public function isAnimated(): bool;


/**
* Apply given modifier to current image
*
* @param ModifierInterface $modifier
* @return ImageInterface
*/
public function modify(ModifierInterface $modifier): ImageInterface;

/**
Expand Down Expand Up @@ -61,10 +101,24 @@ public function toGif(): EncodedImage;
*/
public function toPng(): EncodedImage;

public function pickColor(int $x, int $y, int $frame_key = 0): ?ColorInterface;
public function pickColors(int $x, int $y): CollectionInterface;
public function text(string $text, int $x, int $y, ?callable $init = null): ImageInterface;
public function pickColor(int $x, int $y, int $frame_key = 0): ?ColorInterface;

/**
* Turn image into a greyscale version
*
* @return void
*/
public function greyscale(): ImageInterface;


/**
* Blur current image by given strength
*
* @param int $amount
* @return ImageInterface
*/
public function blur(int $amount = 5): ImageInterface;
public function rotate(float $angle, $background = 'ffffff'): ImageInterface;
public function place($element, string $position = 'top-left', int $offset_x = 0, int $offset_y = 0): ImageInterface;
Expand All @@ -80,13 +134,73 @@ public function pad(int $width, int $height, $background = 'ffffff', string $pos
public function padDown(int $width, int $height, $background = 'ffffff', string $position = 'center'): ImageInterface;
public function drawPixel(int $x, int $y, $color = null): ImageInterface;
public function drawRectangle(int $x, int $y, ?callable $init = null): ImageInterface;

/**
* Draw ellipse ot given position on current image
*
* @param int $x
* @param int $y
* @param null|callable $init
* @return ImageInterface
*/
public function drawEllipse(int $x, int $y, ?callable $init = null): ImageInterface;

/**
* Draw line on image
*
* @param callable|null $init
* @return ImageInterface
*/
public function drawLine(callable $init = null): ImageInterface;

/**
* Draw polygon on image
*
* @param callable|null $init
* @return ImageInterface
*/
public function drawPolygon(callable $init = null): ImageInterface;

/**
* Sharpen the current image with given strength
*
* @param int $amount
* @return ImageInterface
*/
public function sharpen(int $amount = 10): ImageInterface;

/**
* Mirror the current image horizontally
*
* @return void
*/
public function flip(): ImageInterface;

/**
* Mirror the current image vertically
*
* @return void
*/
public function flop(): ImageInterface;

/**
* Return image width in pixels
*
* @return int
*/
public function getWidth(): int;

/**
* Return image height in pixels
*
* @return int
*/
public function getHeight(): int;

/**
* Destroy current image instance and free up memory
*
* @return void
*/
public function destroy(): void;
}

0 comments on commit af9fea0

Please sign in to comment.