- Full name:
\BaconQrCode\Renderer\Image\SvgImageBackEnd
- This class is marked as final and can't be subclassed
- This class implements:
\BaconQrCode\Renderer\Image\ImageBackEndInterface
- This class is a Final class
Constant | Visibility | Type | Value |
---|---|---|---|
PRECISION |
private | 3 |
private \XMLWriter|null $xmlWriter
private int[]|null $stack
private int|null $currentStack
private int|null $gradientCount
public __construct(): mixed
Starts a new image.
public new(int $size, \BaconQrCode\Renderer\Color\ColorInterface $backgroundColor): void
If a previous image was already started, previous data get erased.
Parameters:
Parameter | Type | Description |
---|---|---|
$size |
int | |
$backgroundColor |
\BaconQrCode\Renderer\Color\ColorInterface |
Transforms all following drawing operation coordinates by scaling them by a given factor.
public scale(float $size): void
Parameters:
Parameter | Type | Description |
---|---|---|
$size |
float |
Transforms all following drawing operation coordinates by translating them by a given amount.
public translate(float $x, float $y): void
Parameters:
Parameter | Type | Description |
---|---|---|
$x |
float | |
$y |
float |
Transforms all following drawing operation coordinates by rotating them by a given amount.
public rotate(int $degrees): void
Parameters:
Parameter | Type | Description |
---|---|---|
$degrees |
int |
Pushes the current coordinate transformation onto a stack.
public push(): void
Pops the last coordinate transformation from a stack.
public pop(): void
Draws a path with a given color.
public drawPathWithColor(\BaconQrCode\Renderer\Path\Path $path, \BaconQrCode\Renderer\Color\ColorInterface $color): void
Parameters:
Parameter | Type | Description |
---|---|---|
$path |
\BaconQrCode\Renderer\Path\Path | |
$color |
\BaconQrCode\Renderer\Color\ColorInterface |
Draws a path with a given gradient which spans the box described by the position and size.
public drawPathWithGradient(\BaconQrCode\Renderer\Path\Path $path, \BaconQrCode\Renderer\RendererStyle\Gradient $gradient, float $x, float $y, float $width, float $height): void
Parameters:
Parameter | Type | Description |
---|---|---|
$path |
\BaconQrCode\Renderer\Path\Path | |
$gradient |
\BaconQrCode\Renderer\RendererStyle\Gradient | |
$x |
float | |
$y |
float | |
$width |
float | |
$height |
float |
Ends the image drawing operation and returns the resulting blob.
public done(): string
This should reset the state of the back end and thus this method should only be callable once per image.
private startPathElement(\BaconQrCode\Renderer\Path\Path $path): void
Parameters:
Parameter | Type | Description |
---|---|---|
$path |
\BaconQrCode\Renderer\Path\Path |
private createGradientFill(\BaconQrCode\Renderer\RendererStyle\Gradient $gradient, float $x, float $y, float $width, float $height): string
Parameters:
Parameter | Type | Description |
---|---|---|
$gradient |
\BaconQrCode\Renderer\RendererStyle\Gradient | |
$x |
float | |
$y |
float | |
$width |
float | |
$height |
float |
private getColorString(\BaconQrCode\Renderer\Color\ColorInterface $color): string
Parameters:
Parameter | Type | Description |
---|---|---|
$color |
\BaconQrCode\Renderer\Color\ColorInterface |