MaskPatternTester
Receives a QRDataInterface object and runs the mask pattern tests on it.
ISO/IEC 18004:2000 Section 8.8.2 - Evaluation of masking results
Tags
Table of Contents
- $dataInterface : QRDataInterface
- The data interface that contains the data matrix to test
- __construct() : mixed
- Receives the QRDataInterface
- getBestMaskPattern() : int
- shoves a QRMatrix through the MaskPatternTester to find the lowest penalty mask pattern
- testPattern() : int
- Returns the penalty for the given mask pattern
- testLevel1() : int
- Checks for each group of five or more same-colored modules in a row (or column)
- testLevel2() : int
- Checks for each 2x2 area of same-colored modules in the matrix
- testLevel3() : int
- Checks if there are patterns that look similar to the finder patterns (1:1:3:1:1 ratio)
- testLevel4() : float
- Checks if more than half of the modules are dark or light, with a larger penalty for a larger difference
Properties
$dataInterface
The data interface that contains the data matrix to test
protected
QRDataInterface
$dataInterface
Methods
__construct()
Receives the QRDataInterface
public
__construct(QRDataInterface $dataInterface) : mixed
Parameters
- $dataInterface : QRDataInterface
Tags
Return values
mixed —getBestMaskPattern()
shoves a QRMatrix through the MaskPatternTester to find the lowest penalty mask pattern
public
getBestMaskPattern() : int
Tags
Return values
int —testPattern()
Returns the penalty for the given mask pattern
public
testPattern(int $pattern) : int
Parameters
- $pattern : int
Tags
Return values
int —testLevel1()
Checks for each group of five or more same-colored modules in a row (or column)
protected
testLevel1(array<string|int, mixed> $m, int $size) : int
Parameters
- $m : array<string|int, mixed>
- $size : int
Return values
int —testLevel2()
Checks for each 2x2 area of same-colored modules in the matrix
protected
testLevel2(array<string|int, mixed> $m, int $size) : int
Parameters
- $m : array<string|int, mixed>
- $size : int
Return values
int —testLevel3()
Checks if there are patterns that look similar to the finder patterns (1:1:3:1:1 ratio)
protected
testLevel3(array<string|int, mixed> $m, int $size) : int
Parameters
- $m : array<string|int, mixed>
- $size : int
Return values
int —testLevel4()
Checks if more than half of the modules are dark or light, with a larger penalty for a larger difference
protected
testLevel4(array<string|int, mixed> $m, int $size) : float
Parameters
- $m : array<string|int, mixed>
- $size : int