Properties

$margin

$margin : int

Margin around the QR code, also known as quiet zone.

Type

int

$width

$width : int

Requested width of the rendered image.

Type

int

$height

$height : int

Requested height of the rendered image.

Type

int

$roundDimensions

$roundDimensions : bool

Whether dimensions should be rounded down.

Type

bool

$finalWidth

$finalWidth : int

Final width of the image.

Type

int

$finalHeight

$finalHeight : int

Final height of the image.

Type

int

$blockSize

$blockSize : int

Size of each individual block.

Type

int

$backgroundColor

$backgroundColor : \BaconQrCode\Renderer\Color\ColorInterface

Background color.

Type

ColorInterface

$floorToClosestDimension

$floorToClosestDimension : bool

Whether dimensions should be rounded down

Type

bool

$foregroundColor

$foregroundColor : \BaconQrCode\Renderer\Color\ColorInterface

Foreground color.

Type

ColorInterface

$decorators

$decorators : array

Decorators used on QR codes.

Type

array

$eps

$eps : string

EPS string.

Type

string

$colors

$colors : array

Colors used for drawing.

Type

array

$currentColor

$currentColor : string

Current color.

Type

string

Methods

setMargin()

setMargin(int  $margin) : \BaconQrCode\Renderer\Image\AbstractRenderer

Sets the margin around the QR code.

Parameters

int $margin

Throws

\BaconQrCode\Exception\InvalidArgumentException

Returns

\BaconQrCode\Renderer\Image\AbstractRenderer —

getMargin()

getMargin() : int

Gets the margin around the QR code.

Returns

int —

setWidth()

setWidth(int  $width) : \BaconQrCode\Renderer\Image\AbstractRenderer

Sets the height around the renderd image.

If the width is smaller than the matrix width plus padding, the renderer will automatically use that as the width instead of the specified one.

Parameters

int $width

Returns

\BaconQrCode\Renderer\Image\AbstractRenderer —

getWidth()

getWidth() : int

Gets the width of the rendered image.

Returns

int —

setHeight()

setHeight(int  $height) : \BaconQrCode\Renderer\Image\AbstractRenderer

Sets the height around the renderd image.

If the height is smaller than the matrix height plus padding, the renderer will automatically use that as the height instead of the specified one.

Parameters

int $height

Returns

\BaconQrCode\Renderer\Image\AbstractRenderer —

getHeight()

getHeight() : int

Gets the height around the rendered image.

Returns

int —

setRoundDimensions()

setRoundDimensions(bool  $flag) : \BaconQrCode\Renderer\Image\AbstractRenderer

Sets whether dimensions should be rounded down.

Parameters

bool $flag

Returns

\BaconQrCode\Renderer\Image\AbstractRenderer —

shouldRoundDimensions()

shouldRoundDimensions() : bool

Gets whether dimensions should be rounded down.

Returns

bool —

setBackgroundColor()

setBackgroundColor(\BaconQrCode\Renderer\Color\ColorInterface  $color) : \BaconQrCode\Renderer\Image\AbstractRenderer

Sets background color.

Parameters

\BaconQrCode\Renderer\Color\ColorInterface $color

Returns

\BaconQrCode\Renderer\Image\AbstractRenderer —

getBackgroundColor()

getBackgroundColor() : \BaconQrCode\Renderer\Color\ColorInterface

Gets background color.

Returns

\BaconQrCode\Renderer\Color\ColorInterface —

setForegroundColor()

setForegroundColor(\BaconQrCode\Renderer\Color\ColorInterface  $color) : \BaconQrCode\Renderer\Image\AbstractRenderer

Sets foreground color.

Parameters

\BaconQrCode\Renderer\Color\ColorInterface $color

Returns

\BaconQrCode\Renderer\Image\AbstractRenderer —

getForegroundColor()

getForegroundColor() : \BaconQrCode\Renderer\Color\ColorInterface

Gets foreground color.

Returns

\BaconQrCode\Renderer\Color\ColorInterface —

addDecorator()

addDecorator(\BaconQrCode\Renderer\Image\Decorator\DecoratorInterface  $decorator) : \BaconQrCode\Renderer\Image\AbstractRenderer

Adds a decorator to the renderer.

Parameters

\BaconQrCode\Renderer\Image\Decorator\DecoratorInterface $decorator

Returns

\BaconQrCode\Renderer\Image\AbstractRenderer —

render()

render(\BaconQrCode\Encoder\QrCode  $qrCode) : string

render(): defined by RendererInterface.

Parameters

\BaconQrCode\Encoder\QrCode $qrCode

Returns

string —

init()

init() : void

init(): defined by RendererInterface.

addColor()

addColor(string  $id, \BaconQrCode\Renderer\Color\ColorInterface  $color) : void

addColor(): defined by RendererInterface.

Parameters

string $id
\BaconQrCode\Renderer\Color\ColorInterface $color

drawBackground()

drawBackground(string  $colorId) : void

drawBackground(): defined by RendererInterface.

Parameters

string $colorId

drawBlock()

drawBlock(int  $x, int  $y, string  $colorId) : void

drawBlock(): defined by RendererInterface.

Parameters

int $x
int $y
string $colorId

getByteStream()

getByteStream() : string

getByteStream(): defined by RendererInterface.

Returns

string —

setColor()

setColor(string  $colorId) : void

Sets color to use.

Parameters

string $colorId