interface LayersInterface implements Iterator, Countable, ArrayAccess

The layers interface.

Methods

merge()

Merge layers into the original objects.

$this
animate(string $format, int $delay, int $loops)

Animates layers.

$this
coalesce()

Coalesce layers. Each layer in the sequence is the same size as the first and composited with the next layer in the sequence.

$this
add(ImageInterface $image)

Adds an image at the end of the layers stack.

$this
set(int $offset, ImageInterface $image)

Set an image at offset.

$this
remove(int $offset)

Removes the image at offset.

get(int $offset)

Returns the image at offset.

bool
has(int $offset)

Returns true if a layer at offset is preset.

Details

at line 24
merge()

Merge layers into the original objects.

Exceptions

RuntimeException

at line 38
$this animate(string $format, int $delay, int $loops)

Animates layers.

Parameters

string $format The output output format
int $delay The delay in milliseconds between two frames
int $loops The number of loops, 0 means infinite

Return Value

$this

Exceptions

InvalidArgumentException In case an invalid argument is provided
RuntimeException In case the driver fails to animate

at line 48
$this coalesce()

Coalesce layers. Each layer in the sequence is the same size as the first and composited with the next layer in the sequence.

Return Value

$this

Exceptions

NotSupportedException

at line 59
$this add(ImageInterface $image)

Adds an image at the end of the layers stack.

Parameters

ImageInterface $image

Return Value

$this

Exceptions

RuntimeException

at line 73
$this set(int $offset, ImageInterface $image)

Set an image at offset.

Parameters

int $offset
ImageInterface $image

Return Value

$this

Exceptions

RuntimeException
InvalidArgumentException
OutOfBoundsException

at line 85
$this remove(int $offset)

Removes the image at offset.

Parameters

int $offset

Return Value

$this

Exceptions

RuntimeException
InvalidArgumentException

at line 97
ImageInterface get(int $offset)

Returns the image at offset.

Parameters

int $offset

Return Value

ImageInterface

Exceptions

RuntimeException
InvalidArgumentException

at line 106
bool has(int $offset)

Returns true if a layer at offset is preset.

Parameters

int $offset

Return Value

bool