BitMatrix
in package
Table of Contents
- $bits : array<string|int, mixed>
- $dimension : int
- $formatInfo : FormatInformation|null
- $mirror : bool
- $rowSize : int
- $version : Version|null
- __construct() : mixed
- flip() : self
- <p>Flips the given bit. 1 << (0xf9 & 0x1f)</p>
- get() : bool
- <p>Gets the requested bit, where true means black.</p>
- getDimension() : int
- getFormatInfo() : FormatInformation|null
- getVersion() : Version|null
- mirror() : self
- 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>
- set() : self
- <p>Sets the given bit to true.</p>
- setMirror() : self
- Prepare the parser for a mirrored operation.
- setRegion() : self
- <p>Sets a square region of the bit matrix to true.</p>
- buildFunctionPattern() : self
- See ISO 18004:2006 Annex E
- copyBit() : int
- decodeVersionInformation() : Version|null
- doDecodeFormatInformation() : FormatInformation|null
- numBitsDiffering() : int
- 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>
- unmask() : void
- Implementations of this method reverse the data masking process applied to a QR Code and make its bits ready to read.
- uRShift() : int
Properties
$bits
private
array<string|int, mixed>
$bits
$dimension
private
int
$dimension
$formatInfo
private
FormatInformation|null
$formatInfo
= null
$mirror
private
bool
$mirror
= false
$rowSize
private
int
$rowSize
$version
private
Version|null
$version
= null
Methods
__construct()
public
__construct(int $dimension) : mixed
Parameters
- $dimension : int
Return values
mixed —flip()
<p>Flips the given bit. 1 << (0xf9 & 0x1f)</p>
public
flip(int $x, int $y) : self
Parameters
- $x : int
-
; The horizontal component (i.e. which column)
- $y : int
-
; The vertical component (i.e. which row)
Return values
self —get()
<p>Gets the requested bit, where true means black.</p>
public
get(int $x, int $y) : bool
Parameters
- $x : int
-
The horizontal component (i.e. which column)
- $y : int
-
The vertical component (i.e. which row)
Return values
bool —value of given bit in matrix
getDimension()
public
getDimension() : int
Return values
int —The dimension (width/height) of the matrix
getFormatInfo()
public
getFormatInfo() : FormatInformation|null
Return values
FormatInformation|null —getVersion()
public
getVersion() : Version|null
Return values
Version|null —mirror()
Mirror the bit matrix in order to attempt a second reading.
public
mirror() : self
Return values
self —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
Return values
array<string|int, mixed> —bytes encoded within the QR Code
set()
<p>Sets the given bit to true.</p>
public
set(int $x, int $y) : self
Parameters
- $x : int
-
; The horizontal component (i.e. which column)
- $y : int
-
; The vertical component (i.e. which row)
Return values
self —setMirror()
Prepare the parser for a mirrored operation.
public
setMirror(bool $mirror) : self
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
self —setRegion()
<p>Sets a square region of the bit matrix to true.</p>
public
setRegion(int $left, int $top, int $width, int $height) : self
Parameters
- $left : int
-
; The horizontal position to begin at (inclusive)
- $top : int
-
; The vertical position to begin at (inclusive)
- $width : int
-
; The width of the region
- $height : int
-
; The height of the region
Tags
Return values
self —buildFunctionPattern()
See ISO 18004:2006 Annex E
private
buildFunctionPattern() : self
Return values
self —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
numBitsDiffering(int $a, int $b) : int
Parameters
- $a : int
- $b : int
Return values
int —readFormatInformation()
<p>Reads format information from one of its two locations within the QR Code.</p>
private
readFormatInformation() : FormatInformation
Tags
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>
private
readVersion() : Version
Tags
Return values
Version —encapsulating the QR Code's version
unmask()
Implementations of this method reverse the data masking process applied to a QR Code and make its bits ready to read.
private
unmask() : void
Return values
void —uRShift()
private
uRShift(int $a, int $b) : int
Parameters
- $a : int
- $b : int