\BaconQrCode\Renderer\ImageSvgImageBackEnd

Summary

Methods
Properties
Constants
__construct()
new()
scale()
translate()
rotate()
push()
pop()
drawPathWithColor()
drawPathWithGradient()
done()
No public properties found
PRECISION
No protected methods found
No protected properties found
N/A
startPathElement()
createGradientFill()
getColorString()
$xmlWriter
$stack
$currentStack
$gradientCount
N/A

Constants

PRECISION

PRECISION = 3

Properties

$currentStack

$currentStack : int|null

Type

int|null

$gradientCount

$gradientCount : int|null

Type

int|null

Methods

__construct()

__construct() : mixed

Returns

mixed —

new()

new(int  $size, \BaconQrCode\Renderer\Color\ColorInterface  $backgroundColor) : void

Starts a new image.

If a previous image was already started, previous data get erased.

Parameters

int $size
\BaconQrCode\Renderer\Color\ColorInterface $backgroundColor

scale()

scale(float  $size) : void

Transforms all following drawing operation coordinates by scaling them by a given factor.

Parameters

float $size

translate()

translate(float  $x, float  $y) : void

Transforms all following drawing operation coordinates by translating them by a given amount.

Parameters

float $x
float $y

rotate()

rotate(int  $degrees) : void

Transforms all following drawing operation coordinates by rotating them by a given amount.

Parameters

int $degrees

push()

push() : void

Pushes the current coordinate transformation onto a stack.

pop()

pop() : void

Pops the last coordinate transformation from a stack.

drawPathWithColor()

drawPathWithColor(\BaconQrCode\Renderer\Path\Path  $path, \BaconQrCode\Renderer\Color\ColorInterface  $color) : void

Draws a path with a given color.

Parameters

\BaconQrCode\Renderer\Path\Path $path
\BaconQrCode\Renderer\Color\ColorInterface $color

drawPathWithGradient()

drawPathWithGradient(\BaconQrCode\Renderer\Path\Path  $path, \BaconQrCode\Renderer\RendererStyle\Gradient  $gradient, float  $x, float  $y, float  $width, float  $height) : void

Draws a path with a given gradient which spans the box described by the position and size.

Parameters

\BaconQrCode\Renderer\Path\Path $path
\BaconQrCode\Renderer\RendererStyle\Gradient $gradient
float $x
float $y
float $width
float $height

done()

done() : string

Ends the image drawing operation and returns the resulting blob.

This should reset the state of the back end and thus this method should only be callable once per image.

Returns

string —

startPathElement()

startPathElement(\BaconQrCode\Renderer\Path\Path  $path) : void

Parameters

\BaconQrCode\Renderer\Path\Path $path

createGradientFill()

createGradientFill(\BaconQrCode\Renderer\RendererStyle\Gradient  $gradient, float  $x, float  $y, float  $width, float  $height) : string

Parameters

\BaconQrCode\Renderer\RendererStyle\Gradient $gradient
float $x
float $y
float $width
float $height

Returns

string —

getColorString()

getColorString(\BaconQrCode\Renderer\Color\ColorInterface  $color) : string

Parameters

\BaconQrCode\Renderer\Color\ColorInterface $color

Returns

string —