class Layers extends AbstractLayers

Methods

$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.

$this
setClassFactory(ClassFactoryInterface $classFactory)

Set the class factory instance to be used.

getClassFactory()

Get the class factory instance to be used.

__construct(Image $image, PaletteInterface $palette, Gmagick $resource, int $initialOffset = 0)

No description

merge()

Merge layers into the original objects.

$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
animate(string $format, int $delay, int $loops)

Animates layers.

current()

{@inheritdoc}

key()

{@inheritdoc}

next()

{@inheritdoc}

rewind()

{@inheritdoc}

valid()

{@inheritdoc}

count()

{@inheritdoc}

offsetExists($offset)

{@inheritdoc}

offsetGet($offset)

{@inheritdoc}

offsetSet($offset, $image)

{@inheritdoc}

offsetUnset($offset)

{@inheritdoc}

Details

in AbstractLayers at line 30
$this add(ImageInterface $image)

Adds an image at the end of the layers stack.

Parameters

ImageInterface $image

Return Value

$this

Exceptions

RuntimeException

See also

LayersInterface::add

in AbstractLayers at line 42
$this set(int $offset, ImageInterface $image)

Set an image at offset.

Parameters

int $offset
ImageInterface $image

Return Value

$this

Exceptions

RuntimeException
InvalidArgumentException
OutOfBoundsException

See also

LayersInterface::set

in AbstractLayers at line 54
$this remove(int $offset)

Removes the image at offset.

Parameters

int $offset

Return Value

$this

Exceptions

RuntimeException
InvalidArgumentException

See also

LayersInterface::remove

in AbstractLayers at line 66
ImageInterface get(int $offset)

Returns the image at offset.

Parameters

int $offset

Return Value

ImageInterface

Exceptions

RuntimeException
InvalidArgumentException

See also

LayersInterface::get

in AbstractLayers at line 76
bool has(int $offset)

Returns true if a layer at offset is preset.

Parameters

int $offset

Return Value

bool

See also

LayersInterface::has

in AbstractLayers at line 86
$this setClassFactory(ClassFactoryInterface $classFactory)

Set the class factory instance to be used.

Parameters

ClassFactoryInterface $classFactory

Return Value

$this

See also

ClassFactoryAwareInterface::setClassFactory

in AbstractLayers at line 98
ClassFactoryInterface getClassFactory()

Get the class factory instance to be used.

at line 56
__construct(Image $image, PaletteInterface $palette, Gmagick $resource, int $initialOffset = 0)

Parameters

Image $image
PaletteInterface $palette
Gmagick $resource
int $initialOffset

at line 69
merge()

Merge layers into the original objects.

at line 86
$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

See also

LayersInterface::coalesce

at line 96
$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

See also

LayersInterface::animate

at line 133
current()

{@inheritdoc}

See also

\Iterator::current()

at line 166
key()

{@inheritdoc}

See also

\Iterator::key()

at line 176
next()

{@inheritdoc}

See also

\Iterator::next()

at line 186
rewind()

{@inheritdoc}

See also

\Iterator::rewind()

at line 196
valid()

{@inheritdoc}

See also

\Iterator::valid()

at line 206
count()

{@inheritdoc}

See also

\Countable::count()

at line 220
offsetExists($offset)

{@inheritdoc}

Parameters

$offset

See also

\ArrayAccess::offsetExists()

at line 230
offsetGet($offset)

{@inheritdoc}

Parameters

$offset

See also

\ArrayAccess::offsetGet()

at line 240
offsetSet($offset, $image)

{@inheritdoc}

Parameters

$offset
$image

See also

\ArrayAccess::offsetSet()

at line 293
offsetUnset($offset)

{@inheritdoc}

Parameters

$offset

See also

\ArrayAccess::offsetUnset()