Conversation
QR for a space that is long rather than square: one finder top-left, a five-module sub-finder bottom-right, timing along all four edges, and an alignment column every twenty-odd modules of width. Thirty-two shapes from 7x43 to 17x139, two error correction levels, no mask option -- rMQR defines one mask and spends the bits QR gives a mask number on saying which shape the symbol is, in eighteen bits of BCH written twice under two different masks. Verified with one opinion rather than two, and the difference is stated rather than glossed: module for module against zint at all sixty-four cells in all three modes, but no round trip, because zxing-cpp 3.1.1 lists RMQRCode and decodes neither our symbols nor zint's own. The exemption in DecoderRoundTripTest is gated on that staying true. In place of the missing reader, RmqrTest asserts the tables against each other: the codeword total is the free-module count, every block count divides its own check codewords, and the format code's minimum Hamming distance is the eight BCH(18,6) buys. The mode-splitting search Micro QR introduced is now Encoding\Segmentation, shared by both, with each symbology contributing only what a segment header costs it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QR for a space that is long rather than square. A QR symbol is square because it has three finders in three corners, and that shape is wrong for most of the things barcodes go on: the side of a cable, the barrel of a syringe, the edge of a board. rMQR keeps QR's alphabet, its Reed–Solomon and its zigzag and rearranges the geometry into thirty-two rectangles, from 7×43 up to 17×139.
What is new in the geometry
One finder in the top-left corner and a five-module sub-finder in the bottom-right; timing patterns running the whole way along all four edges rather than QR's two internal lines; an alignment column every twenty-odd modules of width, a 3×3 ring top and bottom joined by a vertical timing line; and three modules in each of the remaining two corners that the alternating edges would otherwise get wrong — which are the only thing distinguishing the two ends of a seven-module-tall rectangle.
Two options, and the missing third is the point
RmqrOptionstakes a shape and an error correction level. There is no mask option, because rMQR defines one mask pattern and no field to say which was used: the bits QR spends on a mask number are spent here saying which of the thirty-two shapes the symbol is. Eighteen bits of BCH over six, written twice and masked with different constants in the two copies — one constant for both draws a symbol whose first copy is right, which is exactly the kind of mistake a small fixture misses.There are two levels, M and H, and no others. A pinned shape is kept rather than grown: a caller who names
Version::R7x99names it because that is the space the label has.Verification: one opinion, not two
zint draws every symbol in the fixture. zxing-cpp 3.1.1 lists
RMQRCodeamong its formats and decodes neither our symbols nor zint's own, so there is no round trip.DecoderRoundTripTestexempts the symbology and gates the exemption on that staying true, so the day a reader appears the suite fails and says to delete it.What replaces the missing reader is coherence. The fixture is exhaustive rather than representative — all sixty-four cells in all three modes, at one character, at the longest payload and in between — and
RmqrTestasserts the tables against each other: the codeword total is the free-module count to within a byte, every block count divides its own check codewords, the single mask is QR's pattern 4 written out from QR's formula, and the format code's minimum Hamming distance is the eight BCH(18,6) is supposed to buy. A wrong generator that still made sixty-four distinct values passes a uniqueness test and fails that one.Three things measured rather than assumed
One extraction
The mode-splitting shortest path Micro QR introduced is now
Encoding\Segmentation, shared by both symbologies, with each contributing only what a segment header costs it — which is the whole of what differs between them. Here the split agrees with zint on every payload in the fixture, so unlike Micro QR's the module comparison is unconditional.Checks
composer lintclean (cs 0/309, phpstan no errors, rector done, kb-lint 0 warnings)SCANME_REQUIRE_DECODER=1round trip 405 tests, 1561 assertionstests/RmqrTest.php+tests/RmqrReferenceTest.php: 1882 tests, 10912 assertionscomposer reference:rmqrregenerates deterministically (782 symbols, 64/64 cells)