Decoder
in package
The main class which implements QR Code decoding -- as opposed to locating and extracting the QR Code from an image.
Tags
Table of Contents
- $eccLevel : EccLevel|null
- $maskPattern : MaskPattern|null
- $version : Version|null
- decode() : DecoderResult
- Decodes a QR Code represented as a BitMatrix.
- decodeBitStream() : DecoderResult
- decodeMatrix() : DecoderResult
- getDataBlocks() : array<string|int, mixed>
- When QR Codes use multiple data blocks, they are actually interleaved.
Properties
$eccLevel
private
EccLevel|null
$eccLevel
= null
$maskPattern
private
MaskPattern|null
$maskPattern
= null
$version
private
Version|null
$version
= null
Methods
decode()
Decodes a QR Code represented as a BitMatrix.
public
decode(LuminanceSourceInterface $source) : DecoderResult
A 1 or "true" is taken to mean a black module.
Parameters
- $source : LuminanceSourceInterface
Tags
Return values
DecoderResult —text and bytes encoded within the QR Code
decodeBitStream()
private
decodeBitStream(array<string|int, mixed> $bytes) : DecoderResult
Parameters
- $bytes : array<string|int, mixed>
Tags
Return values
DecoderResult —decodeMatrix()
private
decodeMatrix(BitMatrix $matrix) : DecoderResult
Parameters
- $matrix : BitMatrix
Tags
Return values
DecoderResult —getDataBlocks()
When QR Codes use multiple data blocks, they are actually interleaved.
private
getDataBlocks(array<string|int, mixed> $rawCodewords) : array<string|int, mixed>
That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This method will separate the data into original blocks.
Parameters
- $rawCodewords : array<string|int, mixed>
-
bytes as read directly from the QR Code
Tags
Return values
array<string|int, mixed> —DataBlocks containing original bytes, "de-interleaved" from representation in the QR Code