Drawer
in package
implements
DrawerInterface, InfoProvider
Drawer implementation using the Gmagick PHP extension.
Table of Contents
Interfaces
- DrawerInterface
- Interface for the drawer.
- InfoProvider
- Interface implemented by classes that provide info about a graphics driver.
Properties
- $gmagick : Gmagick
Methods
- __construct() : mixed
- arc() : $this
- Draws an arc on a starting at a given x, y coordinates under a given start and end angles.
- chord() : $this
- Same as arc, but also connects end points with a straight line.
- circle() : $this
- Draws and circle with center at the given x, y coordinates, and given radius.
- dot() : $this
- Places a one pixel point at specific coordinates and fills it with specified color.
- ellipse() : $this
- Draws and ellipse with center at the given x, y coordinates, and given width and height.
- getDriverInfo() : Info|null
- Get the info about this driver.
- line() : $this
- Draws a line from start(x, y) to end(x, y) coordinates.
- pieSlice() : $this
- Same as arc, but connects end points and the center.
- polygon() : $this
- Draws a polygon using array of x, y coordinates. Must contain at least three coordinates.
- rectangle() : $this
- Draws a rectangle from left, top(x, y) to right, bottom(x, y) coordinates.
- text() : $this
- Annotates image with specified text at a given position starting on the top left of the final text box.
- getColor() : GmagickPixel
- Gets specifically formatted color string from Color instance.
Properties
$gmagick
private
Gmagick
$gmagick
Methods
__construct()
public
__construct(Gmagick $gmagick) : mixed
Parameters
- $gmagick : Gmagick
arc()
Draws an arc on a starting at a given x, y coordinates under a given start and end angles.
public
arc(PointInterface $center, BoxInterface $size, mixed $start, mixed $end, ColorInterface $color[, mixed $thickness = 1 ]) : $this
Parameters
- $center : PointInterface
- $size : BoxInterface
- $start : mixed
- $end : mixed
- $color : ColorInterface
- $thickness : mixed = 1
Tags
Return values
$thischord()
Same as arc, but also connects end points with a straight line.
public
chord(PointInterface $center, BoxInterface $size, mixed $start, mixed $end, ColorInterface $color[, mixed $fill = false ][, mixed $thickness = 1 ]) : $this
Parameters
- $center : PointInterface
- $size : BoxInterface
- $start : mixed
- $end : mixed
- $color : ColorInterface
- $fill : mixed = false
- $thickness : mixed = 1
Tags
Return values
$thiscircle()
Draws and circle with center at the given x, y coordinates, and given radius.
public
circle(PointInterface $center, mixed $radius, ColorInterface $color[, mixed $fill = false ][, mixed $thickness = 1 ]) : $this
Parameters
- $center : PointInterface
- $radius : mixed
- $color : ColorInterface
- $fill : mixed = false
- $thickness : mixed = 1
Tags
Return values
$thisdot()
Places a one pixel point at specific coordinates and fills it with specified color.
public
dot(PointInterface $position, ColorInterface $color) : $this
Parameters
- $position : PointInterface
- $color : ColorInterface
Tags
Return values
$thisellipse()
Draws and ellipse with center at the given x, y coordinates, and given width and height.
public
ellipse(PointInterface $center, BoxInterface $size, ColorInterface $color[, mixed $fill = false ][, mixed $thickness = 1 ]) : $this
Parameters
- $center : PointInterface
- $size : BoxInterface
- $color : ColorInterface
- $fill : mixed = false
- $thickness : mixed = 1
Tags
Return values
$thisgetDriverInfo()
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|nullline()
Draws a line from start(x, y) to end(x, y) coordinates.
public
line(PointInterface $start, PointInterface $end, ColorInterface $color[, mixed $thickness = 1 ]) : $this
Parameters
- $start : PointInterface
- $end : PointInterface
- $color : ColorInterface
- $thickness : mixed = 1
Tags
Return values
$thispieSlice()
Same as arc, but connects end points and the center.
public
pieSlice(PointInterface $center, BoxInterface $size, mixed $start, mixed $end, ColorInterface $color[, mixed $fill = false ][, mixed $thickness = 1 ]) : $this
Parameters
- $center : PointInterface
- $size : BoxInterface
- $start : mixed
- $end : mixed
- $color : ColorInterface
- $fill : mixed = false
- $thickness : mixed = 1
Tags
Return values
$thispolygon()
Draws a polygon using array of x, y coordinates. Must contain at least three coordinates.
public
polygon(array<string|int, mixed> $coordinates, ColorInterface $color[, mixed $fill = false ][, mixed $thickness = 1 ]) : $this
Parameters
- $coordinates : array<string|int, mixed>
- $color : ColorInterface
- $fill : mixed = false
- $thickness : mixed = 1
Tags
Return values
$thisrectangle()
Draws a rectangle from left, top(x, y) to right, bottom(x, y) coordinates.
public
rectangle(PointInterface $leftTop, PointInterface $rightBottom, ColorInterface $color[, mixed $fill = false ][, mixed $thickness = 1 ]) : $this
Parameters
- $leftTop : PointInterface
- $rightBottom : PointInterface
- $color : ColorInterface
- $fill : mixed = false
- $thickness : mixed = 1
Tags
Return values
$thistext()
Annotates image with specified text at a given position starting on the top left of the final text box.
public
text(mixed $string, AbstractFont $font, PointInterface $position[, mixed $angle = 0 ][, mixed $width = null ]) : $this
Parameters
- $string : mixed
- $font : AbstractFont
- $position : PointInterface
- $angle : mixed = 0
- $width : mixed = null
Tags
Return values
$thisgetColor()
Gets specifically formatted color string from Color instance.
private
getColor(ColorInterface $color) : GmagickPixel
Parameters
- $color : ColorInterface