Documentation

QRGdImage extends QROutputAbstract
in package

Converts the matrix into GD images, raw or base64 output (requires ext-gd)

Tags
see
http://php.net/manual/book.image.php

Table of Contents

$image  : resource|GdImage
The GD image resource
$length  : int
the side length of the QR image (modules * scale)
$matrix  : QRMatrix
the (filled) data matrix object
$moduleCount  : int
the current size of the QR matrix
$moduleValues  : array<string|int, mixed>
an (optional) array of color values for the several QR matrix parts
$options  : SettingsContainerInterface
$scale  : int
the current scaling for a QR pixel
__construct()  : mixed
QROutputAbstract constructor.
dump()  : string|resource|GdImage
base64encode()  : string
Returns a base64 data URI for the given string and mime type
dumpImage()  : string
Creates the final image by calling the desired GD output function
getDefaultModuleValue()  : mixed
Returns a defualt value for either dark or light modules (return value depends on the output module)
getModuleValue()  : mixed
Returns the final value for the given input (return value depends on the output module)
moduleValueIsValid()  : bool
Determines whether the given value is valid
saveToFile()  : void
saves the qr data to a file
setModuleValues()  : void
Sets the initial module values
setPixel()  : void
Creates a single QR pixel with the given settings

Properties

$image

The GD image resource

protected resource|GdImage $image
Tags
see
imagecreatetruecolor()

$length

the side length of the QR image (modules * scale)

protected int $length

$moduleValues

an (optional) array of color values for the several QR matrix parts

protected array<string|int, mixed> $moduleValues

$scale

the current scaling for a QR pixel

protected int $scale
Tags
see
QROptions::$scale

Methods

__construct()

QROutputAbstract constructor.

public __construct(SettingsContainerInterface $options, QRMatrix $matrix) : mixed
Parameters
$options : SettingsContainerInterface
$matrix : QRMatrix
Tags
inheritDoc
throws
QRCodeOutputException
Return values
mixed

dump()

public dump([string $file = null ]) : string|resource|GdImage
Parameters
$file : string = null
Tags
inheritDoc
phan-suppress

PhanUndeclaredTypeReturnType, PhanTypeMismatchReturn

throws
ErrorException
Return values
string|resource|GdImage

base64encode()

Returns a base64 data URI for the given string and mime type

protected base64encode(string $data, string $mime) : string
Parameters
$data : string
$mime : string
Return values
string

dumpImage()

Creates the final image by calling the desired GD output function

protected dumpImage() : string
Tags
throws
QRCodeOutputException
Return values
string

getDefaultModuleValue()

Returns a defualt value for either dark or light modules (return value depends on the output module)

protected getDefaultModuleValue(bool $isDark) : mixed
Parameters
$isDark : bool
Tags
inheritDoc
Return values
mixed

getModuleValue()

Returns the final value for the given input (return value depends on the output module)

protected getModuleValue(mixed $value) : mixed
Parameters
$value : mixed
Tags
inheritDoc
Return values
mixed

moduleValueIsValid()

Determines whether the given value is valid

protected moduleValueIsValid(mixed $value) : bool
Parameters
$value : mixed
Tags
inheritDoc
Return values
bool

saveToFile()

saves the qr data to a file

protected saveToFile(string $data, string $file) : void
Parameters
$data : string
$file : string
Tags
see
file_put_contents()
see
QROptions::cachefile
throws
QRCodeOutputException
Return values
void

setModuleValues()

Sets the initial module values

protected setModuleValues() : void
Return values
void

setPixel()

Creates a single QR pixel with the given settings

protected setPixel(int $x, int $y, int $M_TYPE) : void
Parameters
$x : int
$y : int
$M_TYPE : int
Return values
void

Search results