Documentation

BitMatrix
in package

Table of Contents

$bits  : array<string|int, mixed>
$dimension  : int
$rowSize  : int
__construct()  : mixed
buildFunctionPattern()  : BitMatrix
See ISO 18004:2006 Annex E
flip()  : void
<p>Flips the given bit. 1 << (0xf9 & 0x1f)</p>
get()  : bool
<p>Gets the requested bit, where true means black.</p>
getDimension()  : int
mirror()  : void
Mirror the bit matrix in order to attempt a second reading.
set()  : void
<p>Sets the given bit to true.</p>
setRegion()  : void
<p>Sets a square region of the bit matrix to true.</p>
unmask()  : void
<p>Encapsulates data masks for the data bits in a QR code, per ISO 18004:2006 6.8. Implementations of this class can un-mask a raw BitMatrix. For simplicity, they will unmask the entire BitMatrix, including areas used for finder patterns, timing patterns, etc. These areas should be unused after the point they are unmasked anyway.</p>

Properties

$bits

private array<string|int, mixed> $bits

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) : void
Parameters
$x : int

; The horizontal component (i.e. which column)

$y : int

; The vertical component (i.e. which row)

Return values
void

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

mirror()

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

public mirror() : void
Return values
void

set()

<p>Sets the given bit to true.</p>

public set(int $x, int $y) : void
Parameters
$x : int

; The horizontal component (i.e. which column)

$y : int

; The vertical component (i.e. which row)

Return values
void

setRegion()

<p>Sets a square region of the bit matrix to true.</p>

public setRegion(int $left, int $top, int $width, int $height) : void
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
throws
InvalidArgumentException
Return values
void

unmask()

<p>Encapsulates data masks for the data bits in a QR code, per ISO 18004:2006 6.8. Implementations of this class can un-mask a raw BitMatrix. For simplicity, they will unmask the entire BitMatrix, including areas used for finder patterns, timing patterns, etc. These areas should be unused after the point they are unmasked anyway.</p>

public unmask(int $dimension, MaskPattern $maskPattern) : void

Note that the diagram in section 6.8.1 is misleading since it indicates that i is column position and j is row position. In fact, as the text says, i is row position and j is column position.

Implementations of this method reverse the data masking process applied to a QR Code and make its bits ready to read.

Parameters
$dimension : int
$maskPattern : MaskPattern
Return values
void

Search results