MaskPatternTester
in package
Receives a QRData 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
- $qrData : QRData
- The data interface that contains the data matrix to test
- __construct() : mixed
- Receives the QRData object
- getBestMaskPattern() : MaskPattern
- 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
$qrData
The data interface that contains the data matrix to test
private
QRData
$qrData
Methods
__construct()
Receives the QRData object
public
__construct(QRData $qrData) : mixed
Parameters
- $qrData : QRData
Tags
Return values
mixed —getBestMaskPattern()
shoves a QRMatrix through the MaskPatternTester to find the lowest penalty mask pattern
public
getBestMaskPattern() : MaskPattern
Tags
Return values
MaskPattern —testPattern()
Returns the penalty for the given mask pattern
public
testPattern(MaskPattern $pattern) : int
Parameters
- $pattern : MaskPattern
Tags
Return values
int —testLevel1()
Checks for each group of five or more same-colored modules in a row (or column)
private
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
private
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)
private
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
private
testLevel4(array<string|int, mixed> $m, int $size) : float
Parameters
- $m : array<string|int, mixed>
- $size : int