Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give
+penalty to them. This is actually equivalent to the spec's rule, which is to find MxN blocks and give a
+penalty proportional to (M-1)x(N-1), because this is the number of 2x2 blocks inside such a block.
Apply mask penalty rule 3 and return the penalty. Find consecutive runs of 1:1:3:1:1:4
+starting with black, or 4:1:1:3:1:1 starting with white, and give penalty to them. If we
+find patterns like 000010111010000, we give penalty once.
Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give
+penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance.
+ self
+ —
+
+
MaskPattern.php
:
- 84
+ 89
@@ -673,7 +794,7 @@ and j is row position. In fact, as the text says, i is row position and j is col
@@ -692,6 +813,464 @@ and j is row position. In fact, as the text says, i is row position and j is col
—
+
+
+
+ testRule1()
+
+
+
+
+
Apply mask penalty rule 1 and return the penalty. Find repetitive cells with the same color and
+give penalty to them. Example: 00000 or 11111.
+
+
+ public
+ statictestRule1(array<string|int, mixed> $matrix, int $height, int $width) : int
+
+
+
Parameters
+
+
+ $matrix
+ : array<string|int, mixed>
+
+
+
+
+
+
+ $height
+ : int
+
+
+
+
+
+
+ $width
+ : int
+
+
+
+
+
+
+
+
+
+
Return values
+ int
+ —
+
+
+
+
+
+ testRule2()
+
+
+
+
+
Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give
+penalty to them. This is actually equivalent to the spec's rule, which is to find MxN blocks and give a
+penalty proportional to (M-1)x(N-1), because this is the number of 2x2 blocks inside such a block.
+
+
+ public
+ statictestRule2(array<string|int, mixed> $matrix, int $height, int $width) : int
+
+
+
Parameters
+
+
+ $matrix
+ : array<string|int, mixed>
+
+
+
+
+
+
+ $height
+ : int
+
+
+
+
+
+
+ $width
+ : int
+
+
+
+
+
+
+
+
+
+
Return values
+ int
+ —
+
+
+
+
+
+ testRule3()
+
+
+
+
+
Apply mask penalty rule 3 and return the penalty. Find consecutive runs of 1:1:3:1:1:4
+starting with black, or 4:1:1:3:1:1 starting with white, and give penalty to them. If we
+find patterns like 000010111010000, we give penalty once.
+
+
+ public
+ statictestRule3(array<string|int, mixed> $matrix, int $height, int $width) : int
+
+
+
Parameters
+
+
+ $matrix
+ : array<string|int, mixed>
+
+
+
+
+
+
+ $height
+ : int
+
+
+
+
+
+
+ $width
+ : int
+
+
+
+
+
+
+
+
+
+
Return values
+ int
+ —
+
+
+
+
+
+ testRule4()
+
+
+
+
+
Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give
+penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance.
+
+
+ public
+ statictestRule4(array<string|int, mixed> $matrix, int $height, int $width) : int
+
+
+
Parameters
+
+
+ $matrix
+ : array<string|int, mixed>
+
+
+
+
+
+
+ $height
+ : int
+
+
+
+
+
+
+ $width
+ : int
+
+
+
+
+
+
+
+
+
+
Return values
+ int
+ —
+
+
+
+
+
+ applyRule1()
+
+
+
+
+
+
+ private
+ staticapplyRule1(array<string|int, mixed> $matrix, int $height, int $width, bool $isHorizontal) : int
+
+
+
+
Parameters
+
+
+ $matrix
+ : array<string|int, mixed>
+
+
+
+
+
+
+ $height
+ : int
+
+
+
+
+
+
+ $width
+ : int
+
+
+
+
+
+
+ $isHorizontal
+ : bool
+
+
+
+
+
+
+
+
+
+
Return values
+ int
+ —
+
+
+
+
+
+ isWhiteHorizontal()
+
+
+
+
+
+
+ private
+ staticisWhiteHorizontal(array<string|int, mixed> $row, int $width, int $from, int $to) : bool
+
+
+
+
Parameters
+
+
+ $row
+ : array<string|int, mixed>
+
+
+
+
+
+
+ $width
+ : int
+
+
+
+
+
+
+ $from
+ : int
+
+
+
+
+
+
+ $to
+ : int
+
+
+
+
+
+
+
+
+
+
Return values
+ bool
+ —
+
+
+
+
+
+ isWhiteVertical()
+
+
+
+
+
+
+ private
+ staticisWhiteVertical(array<string|int, mixed> $matrix, int $height, int $x, int $from, int $to) : bool
+
+
+
+
Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give
-penalty to them. This is actually equivalent to the spec's rule, which is to find MxN blocks and give a
-penalty proportional to (M-1)x(N-1), because this is the number of 2x2 blocks inside such a block.
Apply mask penalty rule 3 and return the penalty. Find consecutive runs of 1:1:3:1:1:4
-starting with black, or 4:1:1:3:1:1 starting with white, and give penalty to them. If we
-find patterns like 000010111010000, we give penalty once.
Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give
-penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance.
-
-
-
-
-
-
-
-
-
-
- Properties
-
-
-
-
- $qrData
-
-
-
-
-
-
-
The data interface that contains the data matrix to test
Apply mask penalty rule 1 and return the penalty. Find repetitive cells with the same color and
-give penalty to them. Example: 00000 or 11111.
-
-
- private
- testLevel1(array<string|int, mixed> $m, int $size) : int
-
-
-
Parameters
-
-
- $m
- : array<string|int, mixed>
-
-
-
-
-
-
- $size
- : int
-
-
-
-
-
-
-
-
-
-
Return values
- int
- —
-
-
-
-
-
- testLevel2()
-
-
-
-
-
Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give
-penalty to them. This is actually equivalent to the spec's rule, which is to find MxN blocks and give a
-penalty proportional to (M-1)x(N-1), because this is the number of 2x2 blocks inside such a block.
-
-
- private
- testLevel2(array<string|int, mixed> $m, int $size) : int
-
-
-
Parameters
-
-
- $m
- : array<string|int, mixed>
-
-
-
-
-
-
- $size
- : int
-
-
-
-
-
-
-
-
-
-
Return values
- int
- —
-
-
-
-
-
- testLevel3()
-
-
-
-
-
Apply mask penalty rule 3 and return the penalty. Find consecutive runs of 1:1:3:1:1:4
-starting with black, or 4:1:1:3:1:1 starting with white, and give penalty to them. If we
-find patterns like 000010111010000, we give penalty once.
-
-
- private
- testLevel3(array<string|int, mixed> $m, int $size) : int
-
-
-
Parameters
-
-
- $m
- : array<string|int, mixed>
-
-
-
-
-
-
- $size
- : int
-
-
-
-
-
-
-
-
-
-
Return values
- int
- —
-
-
-
-
-
- testLevel4()
-
-
-
-
-
Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give
-penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance.
@@ -1793,7 +1819,7 @@ false => $M_TYPE
@@ -1891,7 +1917,7 @@ Note that there is no restiction on how many times this method could be called o
@@ -1951,7 +1977,7 @@ Note that there is no restiction on how many times this method could be called o
@@ -1986,7 +2012,7 @@ Note that there is no restiction on how many times this method could be called o
@@ -2021,7 +2047,7 @@ Note that there is no restiction on how many times this method could be called o
@@ -2029,23 +2055,12 @@ Note that there is no restiction on how many times this method could be called o
public
- setVersionNumber([bool $test = null ]) : self
+ setVersionNumber() : self
ISO/IEC 18004:2000 Section 8.10
-
Parameters
-
-
- $test
- : bool
- = null
-
-
-
-
-
-
+
Return values
@@ -2067,7 +2082,7 @@ Note that there is no restiction on how many times this method could be called o
@@ -2102,7 +2117,7 @@ Note that there is no restiction on how many times this method could be called o
diff --git a/classes/chillerlan-QRCode-Decoder-Binarizer.html b/classes/chillerlan-QRCode-Decoder-Binarizer.html
index d162d8dff..9471a0855 100644
--- a/classes/chillerlan-QRCode-Decoder-Binarizer.html
+++ b/classes/chillerlan-QRCode-Decoder-Binarizer.html
@@ -229,13 +229,6 @@ but for now it was not a win to use local blocks for 1D.
constructor instead, but there are some advantages to doing it lazily, such as making
profiling easier, and not doing heavy lifting when callers don't expect it.
-
<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>
+
+
@@ -243,7 +343,7 @@ make its bits ready to read.
@@ -277,7 +377,7 @@ make its bits ready to read.
@@ -294,6 +394,74 @@ make its bits ready to read.
+
+
+
- BitMatrix
- —
-
-
BitMatrix.php
:
- 55
+ 61
@@ -444,7 +602,7 @@ make its bits ready to read.
public
- flip(int $x, int $y) : void
+ flip(int $x, int $y) : self
Parameters
@@ -472,7 +630,7 @@ make its bits ready to read.
Return values
- void
+ self
—
@@ -490,7 +648,7 @@ make its bits ready to read.
@@ -546,7 +704,7 @@ make its bits ready to read.
@@ -566,6 +724,70 @@ make its bits ready to read.
+
+
+
+ Version|null
+ —
+
+
BitMatrix.php
:
- 171
+ 194
@@ -588,17 +810,70 @@ make its bits ready to read.
public
- mirror() : void
+ mirror() : self
Return values
- void
+ 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>
+
+
+
BitMatrix.php
:
- 42
+ 46
@@ -621,7 +896,7 @@ make its bits ready to read.
public
- set(int $x, int $y) : void
+ set(int $x, int $y) : self
Parameters
@@ -649,7 +924,56 @@ make its bits ready to read.
Return values
- void
+ 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
—
@@ -667,7 +991,7 @@ make its bits ready to read.
@@ -675,7 +999,7 @@ make its bits ready to read.
public
- setRegion(int $left, int $top, int $width, int $height) : void
+ setRegion(int $left, int $top, int $width, int $height) : self
Parameters
@@ -735,7 +1059,7 @@ make its bits ready to read.
Return values
- void
+ self
—
@@ -743,32 +1067,63 @@ make its bits ready to read.
-
- unmask()
-
+
+ buildFunctionPattern()
+
-
Implementations of this method reverse the data masking process applied to a QR Code and
-make its bits ready to read.
<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>
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>
<p>Encapsulates the result of decoding a matrix of bits. This typically
+
Encapsulates the result of decoding a matrix of bits. This typically
applies to 2D barcode formats. For now it contains the raw bytes obtained,
-as well as a String interpretation of those bytes, if applicable.</p>
+as well as a String interpretation of those bytes, if applicable.
-
- Tags
-
-
-
-
- author
-
-
-
-
Sean Owen
-
-
-
-
@@ -148,42 +136,84 @@ as well as a String interpretation of those bytes, if applicable.</p>
@@ -269,7 +264,7 @@ as well as a String interpretation of those bytes, if applicable.</p>
class="
phpdocumentor-element
-property
- -private
+ -public
"
>
@@ -281,13 +276,211 @@ as well as a String interpretation of those bytes, if applicable.</p>
- private
+ public
+ EccLevel
+ $eccLevel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ public
+ Version
+ $version
+
+
+
+
+
+
+
+
+
+
+ $eccLevel
+
+
+
+
+
+
+
+
+ protectedEccLevel$eccLevel
@@ -303,7 +496,7 @@ as well as a String interpretation of those bytes, if applicable.</p>
class="
phpdocumentor-element
-property
- -private
+ -protected
"
>
@@ -315,13 +508,13 @@ as well as a String interpretation of those bytes, if applicable.</p>
- private
+ protectedarray<string|int, mixed>$rawBytes
@@ -337,7 +530,7 @@ as well as a String interpretation of those bytes, if applicable.</p>
class="
phpdocumentor-element
-property
- -private
+ -protected
"
>
@@ -349,16 +542,16 @@ as well as a String interpretation of those bytes, if applicable.</p>
- private
+ protectedint$structuredAppendParity
-
+ = -1
@@ -371,28 +564,28 @@ as well as a String interpretation of those bytes, if applicable.</p>
class="
phpdocumentor-element
-property
- -private
+ -protected
"
>
-
- $structuredAppendSequenceNumber
-
+
+ $structuredAppendSequence
+
- private
+ protectedint
- $structuredAppendSequenceNumber
-
+ $structuredAppendSequence
+ = -1
@@ -405,7 +598,7 @@ as well as a String interpretation of those bytes, if applicable.</p>
class="
phpdocumentor-element
-property
- -private
+ -protected
"
>
@@ -417,13 +610,13 @@ as well as a String interpretation of those bytes, if applicable.</p>
- private
+ protectedstring$text
@@ -439,7 +632,7 @@ as well as a String interpretation of those bytes, if applicable.</p>
class="
phpdocumentor-element
-property
- -private
+ -protected
"
>
@@ -451,13 +644,13 @@ as well as a String interpretation of those bytes, if applicable.</p>
- private
+ protectedVersion$version
@@ -482,79 +675,60 @@ as well as a String interpretation of those bytes, if applicable.</p>
-public
"
>
-
- __construct()
-
+
+ __set()
+
public
- __construct(array<string|int, mixed> $rawBytes, string $text, Version$version, EccLevel$eccLevel[, int $saSequence = -1 ][, int $saParity = -1 ]) : mixed
+ __set(mixed $property, mixed $value) : void
- mixed
+ void
—
@@ -572,7 +746,7 @@ as well as a String interpretation of those bytes, if applicable.</p>
@@ -584,6 +758,19 @@ as well as a String interpretation of those bytes, if applicable.</p>
+
+ Tags
+
+
+
+
+ inheritDoc
+
+
+
+
+
+
Return values
string
@@ -597,192 +784,52 @@ as well as a String interpretation of those bytes, if applicable.</p>
-public
"
>
-
raw bytes encoded by the barcode, if applicable, otherwise null
-
-
-
-
-
-
- getStructuredAppendParity()
-
-
-
-
-
-
- public
- getStructuredAppendParity() : int
-
-
-
-
-
-
Return values
- int
- —
-
-
-
-
-
- getStructuredAppendSequenceNumber()
-
-
-
-
-
-
- public
- getStructuredAppendSequenceNumber() : int
-
-
-
-
-
-
Return values
- int
- —
-
-
-
-
-
- getText()
-
-
-
-
-
-
- public
- getText() : string
-
-
-
-
-
-
Return values
- string
- —
-
raw text encoded by the barcode
-
-
-
-
-
-
- getVersion()
-
-
-
-
-
-
- public
- getVersion() : Version
-
-
-
-
-
-
Return values
- Version
+ self
—
@@ -800,7 +847,7 @@ as well as a String interpretation of those bytes, if applicable.</p>
diff --git a/classes/chillerlan-QRCode-Detector-Detector.html b/classes/chillerlan-QRCode-Detector-Detector.html
index b420cf1dc..37e42a2ab 100644
--- a/classes/chillerlan-QRCode-Detector-Detector.html
+++ b/classes/chillerlan-QRCode-Detector-Detector.html
@@ -111,7 +111,7 @@
@@ -252,7 +252,7 @@ of another po$(another finder pattern center), and in the opposite direction too
@@ -290,7 +290,7 @@ of another po$(another finder pattern center), and in the opposite direction too
@@ -298,14 +298,14 @@ of another po$(another finder pattern center), and in the opposite direction too
public
- __construct(BitMatrix$image) : mixed
+ __construct(LuminanceSourceInterface$source) : mixed
@@ -334,7 +334,7 @@ of another po$(another finder pattern center), and in the opposite direction too
@@ -367,7 +367,7 @@ of another po$(another finder pattern center), and in the opposite direction too
@@ -442,7 +442,7 @@ of the three finder patterns.</p>
@@ -496,7 +496,7 @@ width of each, measuring along the axis between their centers.</p>
@@ -579,7 +579,7 @@ of the finder patterns and estimated module size.</p>
@@ -654,7 +654,7 @@ of the finder patterns and estimated module size.</p>
@@ -729,7 +729,7 @@ guessed to contain it.</p>
@@ -802,7 +802,7 @@ may be skewed or rotated.
diff --git a/classes/chillerlan-QRCode-QRCode.html b/classes/chillerlan-QRCode-QRCode.html
index 7475d81d7..ba1638110 100644
--- a/classes/chillerlan-QRCode-QRCode.html
+++ b/classes/chillerlan-QRCode-QRCode.html
@@ -296,13 +296,6 @@