interface ImagineInterface implements ClassFactoryAwareInterface

The imagine interface.

Constants

VERSION

Methods

$this
setClassFactory(ClassFactoryInterface $classFactory)

Set the class factory instance to be used.

getClassFactory()

Get the class factory instance to be used.

create(BoxInterface $size, ColorInterface $color = null)

Creates a new empty image with an optional background color.

open(string|LoaderInterface|mixed $path)

Opens an existing image from $path.

load(string $string)

Loads an image from a binary $string.

read(resource $resource)

Loads an image from a resource $resource.

font(string $file, int $size, ColorInterface $color)

Constructs a font with specified $file, $size and $color.

$this
setMetadataReader(MetadataReaderInterface $metadataReader)

Set the object to be used to read image metadata.

getMetadataReader()

Get the object to be used to read image metadata.

Details

$this setClassFactory(ClassFactoryInterface $classFactory)

Set the class factory instance to be used.

Parameters

ClassFactoryInterface $classFactory

Return Value

$this

ClassFactoryInterface getClassFactory()

Get the class factory instance to be used.

Return Value

ClassFactoryInterface

at line 36
ImageInterface create(BoxInterface $size, ColorInterface $color = null)

Creates a new empty image with an optional background color.

Parameters

BoxInterface $size
ColorInterface $color

Return Value

ImageInterface

Exceptions

InvalidArgumentException
RuntimeException

at line 47
ImageInterface open(string|LoaderInterface|mixed $path)

Opens an existing image from $path.

Parameters

string|LoaderInterface|mixed $path the file path, a LoaderInterface instance, or an object whose string representation is the image path

Return Value

ImageInterface

Exceptions

RuntimeException

at line 58
ImageInterface load(string $string)

Loads an image from a binary $string.

Parameters

string $string

Return Value

ImageInterface

Exceptions

RuntimeException

at line 69
ImageInterface read(resource $resource)

Loads an image from a resource $resource.

Parameters

resource $resource

Return Value

ImageInterface

Exceptions

RuntimeException

at line 82
FontInterface font(string $file, int $size, ColorInterface $color)

Constructs a font with specified $file, $size and $color.

The font size is to be specified in points (e.g. 10pt means 10)

Parameters

string $file
int $size
ColorInterface $color

Return Value

FontInterface

at line 91
$this setMetadataReader(MetadataReaderInterface $metadataReader)

Set the object to be used to read image metadata.

Parameters

MetadataReaderInterface $metadataReader

Return Value

$this

at line 98
MetadataReaderInterface getMetadataReader()

Get the object to be used to read image metadata.