Imagine
extends AbstractImagine
in package
implements
InfoProvider
Imagine implementation using the Imagick PHP extension.
Tags
Table of Contents
Interfaces
- InfoProvider
- Interface implemented by classes that provide info about a graphics driver.
Properties
Methods
- __construct() : mixed
- create() : ImageInterface
- Creates a new empty image with an optional background color.
- font() : FontInterface
- Constructs a font with specified $file, $size and $color.
- getClassFactory() : ClassFactoryInterface
- Get the class factory instance to be used.
- getDriverInfo() : Info|null
- Get the info about this driver.
- getMetadataReader() : MetadataReaderInterface
- Get the object to be used to read image metadata.
- load() : ImageInterface
- Loads an image from a binary $string.
- open() : ImageInterface
- Opens an existing image from $path.
- read() : ImageInterface
- Loads an image from a resource $resource.
- setClassFactory() : $this
- Set the class factory instance to be used.
- setMetadataReader() : $this
- Set the object to be used to read image metadata.
- checkPath() : string
- Checks a path that could be used with ImagineInterface::open and returns a proper string.
- createPalette() : CMYK|Grayscale|RGB
- Returns the palette corresponding to an \Imagick resource colorspace.
Properties
$classFactory
private
ClassFactoryInterface
$classFactory
$metadataReader
private
MetadataReaderInterface|null
$metadataReader
Methods
__construct()
public
__construct() : mixed
Tags
create()
Creates a new empty image with an optional background color.
public
create(BoxInterface $size[, ColorInterface $color = null ]) : ImageInterface
Parameters
- $size : BoxInterface
- $color : ColorInterface = null
Tags
Return values
ImageInterfacefont()
Constructs a font with specified $file, $size and $color.
public
font(mixed $file, mixed $size, ColorInterface $color) : FontInterface
Parameters
- $file : mixed
- $size : mixed
- $color : ColorInterface
Tags
Return values
FontInterfacegetClassFactory()
Get the class factory instance to be used.
public
getClassFactory() : ClassFactoryInterface
Tags
Return values
ClassFactoryInterfacegetDriverInfo()
Get the info about this driver.
public
static getDriverInfo([mixed $required = true ]) : Info|null
Parameters
- $required : mixed = true
-
when the driver is not available: if FALSE the function returns NULL, if TRUE the driver throws a \Imagine\Exception\NotSupportedException
Tags
Return values
Info|nullgetMetadataReader()
Get the object to be used to read image metadata.
public
getMetadataReader() : MetadataReaderInterface
Tags
Return values
MetadataReaderInterfaceload()
Loads an image from a binary $string.
public
load(mixed $string) : ImageInterface
Parameters
- $string : mixed
Tags
Return values
ImageInterfaceopen()
Opens an existing image from $path.
public
open(mixed $path) : ImageInterface
Parameters
- $path : mixed
-
the file path, a LoaderInterface instance, or an object whose string representation is the image path
Tags
Return values
ImageInterfaceread()
Loads an image from a resource $resource.
public
read(mixed $resource) : ImageInterface
Parameters
- $resource : mixed
Tags
Return values
ImageInterfacesetClassFactory()
Set the class factory instance to be used.
public
setClassFactory(ClassFactoryInterface $classFactory) : $this
Parameters
- $classFactory : ClassFactoryInterface
Tags
Return values
$thissetMetadataReader()
Set the object to be used to read image metadata.
public
setMetadataReader(MetadataReaderInterface $metadataReader) : $this
Parameters
- $metadataReader : MetadataReaderInterface
Tags
Return values
$thischeckPath()
Checks a path that could be used with ImagineInterface::open and returns a proper string.
protected
checkPath(string|object $path) : string
Parameters
- $path : string|object
Tags
Return values
stringcreatePalette()
Returns the palette corresponding to an \Imagick resource colorspace.
private
createPalette(Imagick $imagick) : CMYK|Grayscale|RGB
Parameters
- $imagick : Imagick