Documentation

BitMatrixParser
in package

Tags
author

Sean Owen

Table of Contents

$bitMatrix  : BitMatrix
$mirror  : bool
$parsedFormatInfo  : FormatInformation|null
$parsedVersion  : Version|null
__construct()  : mixed
mirror()  : void
Mirror the bit matrix in order to attempt a second reading.
readCodewords()  : array<string|int, mixed>
<p>Reads the bits in the {@link BitMatrix} representing the finder pattern in the correct order in order to reconstruct the codewords bytes contained within the QR Code.</p>
readFormatInformation()  : FormatInformation
<p>Reads format information from one of its two locations within the QR Code.</p>
readVersion()  : Version
<p>Reads version information from one of its two locations within the QR Code.</p>
setMirror()  : void
Prepare the parser for a mirrored operation.
uRShift()  : int
copyBit()  : int
decodeVersionInformation()  : Version|null
doDecodeFormatInformation()  : FormatInformation|null
numBitsDiffering()  : int

Properties

Methods

__construct()

public __construct(BitMatrix $bitMatrix) : mixed
Parameters
$bitMatrix : BitMatrix
Tags
throws
RuntimeException

if dimension is not >= 21 and 1 mod 4

Return values
mixed —

mirror()

Mirror the bit matrix in order to attempt a second reading.

public mirror() : void
Return values
void —

readCodewords()

<p>Reads the bits in the {@link BitMatrix} representing the finder pattern in the correct order in order to reconstruct the codewords bytes contained within the QR Code.</p>

public readCodewords() : array<string|int, mixed>
Tags
throws
RuntimeException

if the exact number of bytes expected is not read

Return values
array<string|int, mixed> —

bytes encoded within the QR Code

readFormatInformation()

<p>Reads format information from one of its two locations within the QR Code.</p>

public readFormatInformation() : FormatInformation
Tags
throws
RuntimeException

if both format information locations cannot be parsed as the valid encoding of format information

Return values
FormatInformation —

encapsulating the QR Code's format info

readVersion()

<p>Reads version information from one of its two locations within the QR Code.</p>

public readVersion() : Version
Tags
throws
RuntimeException

if both version information locations cannot be parsed as the valid encoding of version information

Return values
Version —

encapsulating the QR Code's version

setMirror()

Prepare the parser for a mirrored operation.

public setMirror(bool $mirror) : void

This flag has effect only on the and the . Before proceeding with the method should be called.

Parameters
$mirror : bool

Whether to read version and format information mirrored.

Return values
void —

uRShift()

public static uRShift(int $a, int $b) : int
Parameters
$a : int
$b : int
Return values
int —

copyBit()

private copyBit(int $i, int $j, int $versionBits) : int
Parameters
$i : int
$j : int
$versionBits : int
Return values
int —

decodeVersionInformation()

private decodeVersionInformation(int $versionBits) : Version|null
Parameters
$versionBits : int
Return values
Version|null —

doDecodeFormatInformation()

private doDecodeFormatInformation(int $maskedFormatInfo1, int $maskedFormatInfo2) : FormatInformation|null
Parameters
$maskedFormatInfo1 : int

format info indicator, with mask still applied

$maskedFormatInfo2 : int

second copy of same info; both are checked at the same time to establish best match

Return values
FormatInformation|null —

information about the format it specifies, or null if doesn't seem to match any known pattern

numBitsDiffering()

private static numBitsDiffering(int $a, int $b) : int
Parameters
$a : int
$b : int
Return values
int —

Search results