QROptions
extends SettingsContainerAbstract
in package
Uses
QROptionsTrait
The QRCode settings container
Table of Contents
- $addQuietzone : bool
- $cachefile : string|null
- $cssClass : string
- $eccLevel : int
- $eol : string
- $fpdfMeasureUnit : string
- $imageBase64 : bool
- $imageTransparencyBG : array<string|int, mixed>
- $imageTransparent : bool
- $imagickBG : string|null
- $imagickFormat : string
- $jpegQuality : int
- $markupDark : string
- $markupLight : string
- $maskPattern : int
- $moduleValues : array<string|int, mixed>|null
- $outputInterface : string|null
- $outputType : string
- $pngCompression : int
- $quietzoneSize : int
- $returnResource : bool
- $scale : int
- $svgDefs : string
- $svgOpacity : float
- $svgViewBoxSize : int
- $textDark : string
- $textLight : string
- $useImagickIfAvailable : bool
- $version : int
- $versionMax : int
- $versionMin : int
- $addQuietzone : bool
- Add a "quiet zone" (margin) according to the QR code spec
- $cachefile : string|null
- /path/to/cache.file
- $cssClass : string
- a common css class
- $eccLevel : int
- Error correct level
- $eol : string
- newline string [HTML, SVG, TEXT]
- $fpdfMeasureUnit : string
- Measurement unit for FPDF output: pt, mm, cm, in (defaults to "pt")
- $imageBase64 : bool
- toggle base64 or raw image data
- $imageTransparencyBG : array<string|int, mixed>
- $imageTransparent : bool
- toggle transparency, not supported by jpg
- $imagickBG : string|null
- Imagick background color (defaults to "transparent")
- $imagickFormat : string
- Imagick output format
- $jpegQuality : int
- $markupDark : string
- markup substitute for dark (CSS value)
- $markupLight : string
- markup substitute for light (CSS value)
- $maskPattern : int
- Mask Pattern to use (no value in using, mostly for unit testing purposes)
- $moduleValues : array<string|int, mixed>|null
- Module values map
- $outputInterface : string|null
- the FQCN of the custom QROutputInterface if $outputType is set to QRCode::OUTPUT_CUSTOM
- $outputType : string
- The output type
- $pngCompression : int
- $quietzoneSize : int
- Size of the quiet zone
- $returnResource : bool
- Return the image resource instead of a render if applicable.
- $scale : int
- size of a QR code pixel [SVG, IMAGE_*], HTML via CSS
- $svgDefs : string
- anything between <defs>
- $svgOpacity : float
- SVG opacity
- $svgViewBoxSize : int|null
- SVG viewBox size. a single integer number which defines width/height of the viewBox attribute.
- $textDark : string
- string substitute for dark
- $textLight : string
- string substitute for light
- $useImagickIfAvailable : bool
- use Imaagick (if available) when reading QR Codes
- $version : int
- QR Code version number
- $versionMax : int
- Maximum QR version
- $versionMin : int
- Minimum QR version
- set_eccLevel() : void
- sets the error correction level
- set_fpdfMeasureUnit() : void
- sets the FPDF measurement unit
- set_imageTransparencyBG() : void
- sets the transparency background color
- set_maskPattern() : void
- sets/clamps the mask pattern
- set_useImagickIfAvailable() : void
- enables Imagick for the QR Code reader if the extension is available
- set_version() : void
- sets/clamps the version number
- set_versionMax() : void
- sets the maximum version number
- set_versionMin() : void
- sets the minimum version number
- setMinMaxVersion() : void
- clamp min/max version number
Properties
$addQuietzone
public
bool
$addQuietzone
$cachefile
public
string|null
$cachefile
$cssClass
public
string
$cssClass
$eccLevel
public
int
$eccLevel
$eol
public
string
$eol
$fpdfMeasureUnit
public
string
$fpdfMeasureUnit
$imageBase64
public
bool
$imageBase64
$imageTransparencyBG
public
array<string|int, mixed>
$imageTransparencyBG
$imageTransparent
public
bool
$imageTransparent
$imagickBG
public
string|null
$imagickBG
$imagickFormat
public
string
$imagickFormat
$jpegQuality
public
int
$jpegQuality
$markupDark
public
string
$markupDark
$markupLight
public
string
$markupLight
$maskPattern
public
int
$maskPattern
$moduleValues
public
array<string|int, mixed>|null
$moduleValues
$outputInterface
public
string|null
$outputInterface
$outputType
public
string
$outputType
$pngCompression
public
int
$pngCompression
$quietzoneSize
public
int
$quietzoneSize
$returnResource
public
bool
$returnResource
$scale
public
int
$scale
$svgDefs
public
string
$svgDefs
$svgOpacity
public
float
$svgOpacity
$svgViewBoxSize
public
int
$svgViewBoxSize
$textDark
public
string
$textDark
$textLight
public
string
$textLight
$useImagickIfAvailable
public
bool
$useImagickIfAvailable
$version
public
int
$version
$versionMax
public
int
$versionMax
$versionMin
public
int
$versionMin
$addQuietzone
Add a "quiet zone" (margin) according to the QR code spec
protected
bool
$addQuietzone
= true
$cachefile
/path/to/cache.file
protected
string|null
$cachefile
= null
$cssClass
a common css class
protected
string
$cssClass
= ''
$eccLevel
Error correct level
protected
int
$eccLevel
= chillerlanQRCodeCommonEccLevel::L
QRCode::ECC_X where X is:
- L => 7%
- M => 15%
- Q => 25%
- H => 30%
$eol
newline string [HTML, SVG, TEXT]
protected
string
$eol
= PHP_EOL
$fpdfMeasureUnit
Measurement unit for FPDF output: pt, mm, cm, in (defaults to "pt")
protected
string
$fpdfMeasureUnit
= 'pt'
Tags
$imageBase64
toggle base64 or raw image data
protected
bool
$imageBase64
= true
$imageTransparencyBG
protected
array<string|int, mixed>
$imageTransparencyBG
= [255, 255, 255]
Tags
$imageTransparent
toggle transparency, not supported by jpg
protected
bool
$imageTransparent
= true
$imagickBG
Imagick background color (defaults to "transparent")
protected
string|null
$imagickBG
= null
Tags
$imagickFormat
Imagick output format
protected
string
$imagickFormat
= 'png'
Tags
$jpegQuality
protected
int
$jpegQuality
= 85
Tags
$markupDark
markup substitute for dark (CSS value)
protected
string
$markupDark
= '#000'
$markupLight
markup substitute for light (CSS value)
protected
string
$markupLight
= '#fff'
$maskPattern
Mask Pattern to use (no value in using, mostly for unit testing purposes)
protected
int
$maskPattern
= chillerlanQRCodeQRCode::MASK_PATTERN_AUTO
[0...7] or QRCode::MASK_PATTERN_AUTO
$moduleValues
Module values map
protected
array<string|int, mixed>|null
$moduleValues
= null
- HTML, IMAGICK: #ABCDEF, cssname, rgb(), rgba()...
- IMAGE: [63, 127, 255] // R, G, B
$outputInterface
the FQCN of the custom QROutputInterface if $outputType is set to QRCode::OUTPUT_CUSTOM
protected
string|null
$outputInterface
= null
$outputType
The output type
protected
string
$outputType
= chillerlanQRCodeQRCode::OUTPUT_IMAGE_PNG
- QRCode::OUTPUT_MARKUP_XXXX where XXXX = HTML, SVG
- QRCode::OUTPUT_IMAGE_XXX where XXX = PNG, GIF, JPG
- QRCode::OUTPUT_STRING_XXXX where XXXX = TEXT, JSON
- QRCode::OUTPUT_CUSTOM
$pngCompression
protected
int
$pngCompression
= -1
Tags
$quietzoneSize
Size of the quiet zone
protected
int
$quietzoneSize
= 4
internally clamped to [0 ... $moduleCount / 2], defaults to 4 modules
$returnResource
Return the image resource instead of a render if applicable.
protected
bool
$returnResource
= false
This option overrides other output options, such as $cachefile and $imageBase64.
Supported by the following modules:
- QRImage: resource (PHP < 8), GdImage
- QRImagick: Imagick
- QRFpdf: FPDF
Tags
$scale
size of a QR code pixel [SVG, IMAGE_*], HTML via CSS
protected
int
$scale
= 5
$svgDefs
anything between <defs>
protected
string
$svgDefs
= '<style>rect{shape-rendering:crispEdges}</style>'
Tags
$svgOpacity
SVG opacity
protected
float
$svgOpacity
= 1.0
$svgViewBoxSize
SVG viewBox size. a single integer number which defines width/height of the viewBox attribute.
protected
int|null
$svgViewBoxSize
= null
viewBox="0 0 x x"
Tags
$textDark
string substitute for dark
protected
string
$textDark
= '🔴'
$textLight
string substitute for light
protected
string
$textLight
= 'â•'
$useImagickIfAvailable
use Imaagick (if available) when reading QR Codes
protected
bool
$useImagickIfAvailable
= false
$version
QR Code version number
protected
int
$version
= chillerlanQRCodeQRCode::VERSION_AUTO
[1 ... 40] or QRCode::VERSION_AUTO
$versionMax
Maximum QR version
protected
int
$versionMax
= 40
$versionMin
Minimum QR version
protected
int
$versionMin
= 1
if $version = QRCode::VERSION_AUTO
Methods
set_eccLevel()
sets the error correction level
protected
set_eccLevel(int $eccLevel) : void
Parameters
- $eccLevel : int
Tags
Return values
void —set_fpdfMeasureUnit()
sets the FPDF measurement unit
protected
set_fpdfMeasureUnit(string $unit) : void
Parameters
- $unit : string
Tags
Return values
void —set_imageTransparencyBG()
sets the transparency background color
protected
set_imageTransparencyBG(array<string|int, mixed> $imageTransparencyBG) : void
Parameters
- $imageTransparencyBG : array<string|int, mixed>
Tags
Return values
void —set_maskPattern()
sets/clamps the mask pattern
protected
set_maskPattern(int $maskPattern) : void
Parameters
- $maskPattern : int
Return values
void —set_useImagickIfAvailable()
enables Imagick for the QR Code reader if the extension is available
protected
set_useImagickIfAvailable(bool $useImagickIfAvailable) : void
Parameters
- $useImagickIfAvailable : bool
Return values
void —set_version()
sets/clamps the version number
protected
set_version(int $version) : void
Parameters
- $version : int
Return values
void —set_versionMax()
sets the maximum version number
protected
set_versionMax(int $version) : void
Parameters
- $version : int
Return values
void —set_versionMin()
sets the minimum version number
protected
set_versionMin(int $version) : void
Parameters
- $version : int
Return values
void —setMinMaxVersion()
clamp min/max version number
protected
setMinMaxVersion(int $versionMin, int $versionMax) : void
Parameters
- $versionMin : int
- $versionMax : int