interface DrawerInterface

Interface for the drawer.

Methods

$this
arc(PointInterface $center, BoxInterface $size, int $start, int $end, ColorInterface $color, int $thickness = 1)

Draws an arc on a starting at a given x, y coordinates under a given start and end angles.

$this
chord(PointInterface $center, BoxInterface $size, int $start, int $end, ColorInterface $color, bool $fill = false, int $thickness = 1)

Same as arc, but also connects end points with a straight line.

$this
circle(PointInterface $center, int $radius, ColorInterface $color, bool $fill = false, int $thickness = 1)

Draws and circle with center at the given x, y coordinates, and given radius.

$this
ellipse(PointInterface $center, BoxInterface $size, ColorInterface $color, bool $fill = false, int $thickness = 1)

Draws and ellipse with center at the given x, y coordinates, and given width and height.

$this
line(PointInterface $start, PointInterface $end, ColorInterface $outline, int $thickness = 1)

Draws a line from start(x, y) to end(x, y) coordinates.

$this
pieSlice(PointInterface $center, BoxInterface $size, int $start, int $end, ColorInterface $color, bool $fill = false, int $thickness = 1)

Same as arc, but connects end points and the center.

$this
dot(PointInterface $position, ColorInterface $color)

Places a one pixel point at specific coordinates and fills it with specified color.

$this
rectangle(PointInterface $leftTop, PointInterface $rightBottom, ColorInterface $color, bool $fill = false, int $thickness = 1)

Draws a rectangle from left, top(x, y) to right, bottom(x, y) coordinates.

$this
polygon(array $coordinates, ColorInterface $color, bool $fill = false, int $thickness = 1)

Draws a polygon using array of x, y coordinates. Must contain at least three coordinates.

$this
text(string $string, AbstractFont $font, PointInterface $position, int $angle = 0, int $width = null)

Annotates image with specified text at a given position starting on the top left of the final text box.

Details

at line 39
$this arc(PointInterface $center, BoxInterface $size, int $start, int $end, ColorInterface $color, int $thickness = 1)

Draws an arc on a starting at a given x, y coordinates under a given start and end angles.

Parameters

PointInterface $center
BoxInterface $size
int $start
int $end
ColorInterface $color
int $thickness

Return Value

$this

Exceptions

RuntimeException

at line 56
$this chord(PointInterface $center, BoxInterface $size, int $start, int $end, ColorInterface $color, bool $fill = false, int $thickness = 1)

Same as arc, but also connects end points with a straight line.

Parameters

PointInterface $center
BoxInterface $size
int $start
int $end
ColorInterface $color
bool $fill
int $thickness

Return Value

$this

Exceptions

RuntimeException

at line 71
$this circle(PointInterface $center, int $radius, ColorInterface $color, bool $fill = false, int $thickness = 1)

Draws and circle with center at the given x, y coordinates, and given radius.

Parameters

PointInterface $center
int $radius
ColorInterface $color
bool $fill
int $thickness

Return Value

$this

Exceptions

RuntimeException

at line 86
$this ellipse(PointInterface $center, BoxInterface $size, ColorInterface $color, bool $fill = false, int $thickness = 1)

Draws and ellipse with center at the given x, y coordinates, and given width and height.

Parameters

PointInterface $center
BoxInterface $size
ColorInterface $color
bool $fill
int $thickness

Return Value

$this

Exceptions

RuntimeException

at line 98
$this line(PointInterface $start, PointInterface $end, ColorInterface $outline, int $thickness = 1)

Draws a line from start(x, y) to end(x, y) coordinates.

Parameters

PointInterface $start
PointInterface $end
ColorInterface $outline
int $thickness

Return Value

$this

at line 115
$this pieSlice(PointInterface $center, BoxInterface $size, int $start, int $end, ColorInterface $color, bool $fill = false, int $thickness = 1)

Same as arc, but connects end points and the center.

Parameters

PointInterface $center
BoxInterface $size
int $start
int $end
ColorInterface $color
bool $fill
int $thickness

Return Value

$this

Exceptions

RuntimeException

at line 128
$this dot(PointInterface $position, ColorInterface $color)

Places a one pixel point at specific coordinates and fills it with specified color.

Parameters

PointInterface $position
ColorInterface $color

Return Value

$this

Exceptions

RuntimeException

at line 143
$this rectangle(PointInterface $leftTop, PointInterface $rightBottom, ColorInterface $color, bool $fill = false, int $thickness = 1)

Draws a rectangle from left, top(x, y) to right, bottom(x, y) coordinates.

Parameters

PointInterface $leftTop
PointInterface $rightBottom
ColorInterface $color
bool $fill
int $thickness

Return Value

$this

Exceptions

RuntimeException

at line 157
$this polygon(array $coordinates, ColorInterface $color, bool $fill = false, int $thickness = 1)

Draws a polygon using array of x, y coordinates. Must contain at least three coordinates.

Parameters

array $coordinates
ColorInterface $color
bool $fill
int $thickness

Return Value

$this

Exceptions

RuntimeException

at line 174
$this text(string $string, AbstractFont $font, PointInterface $position, int $angle = 0, int $width = null)

Annotates image with specified text at a given position starting on the top left of the final text box.

The rotation is done CW

Parameters

string $string
AbstractFont $font
PointInterface $position
int $angle
int $width

Return Value

$this

Exceptions

RuntimeException