Add Aztec code generator
ClosedPublic

Authored by vkrause on Oct 29 2017, 3:26 PM.

Details

Summary

Needed e.g. for boarding pass rendering in D8395.

Diff Detail

Repository
R280 Prison
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
vkrause created this revision.Oct 29 2017, 3:26 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 29 2017, 3:26 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
dfaure requested changes to this revision.Nov 6 2017, 4:42 PM
dfaure added a subscriber: dfaure.
dfaure added inline comments.
autotests/CMakeLists.txt
21

I suggest using ecm_add_test

autotests/aztecbarcodetest.cpp
161

typo for Compact?

src/lib/aztecbarcode.cpp
735

missing {...} on single-line statements (repeats)

src/lib/reedsolomon_p.h
27–28

_P_H to match the filename

This revision now requires changes to proceed.Nov 6 2017, 4:42 PM

Thanks for this contribution. I think it is good and needed.

autotests/CMakeLists.txt
2

I'd like an extra level of directories given the large amount of test files, so we have e.g. autotests/aztec/ with the relevant files and helpers.

autotests/aztec-compact-data-0011.png
1 ↗(On Diff #21526)

For all these images, are this the only valid encoding for the relevant data, or are there enough extra data in aztec codes that a valid set of data can be encoded in multiple ways ?

vkrause added inline comments.Nov 10 2017, 10:17 AM
autotests/aztec-compact-data-0011.png
1 ↗(On Diff #21526)

There are two kinds of test images here, those that test just the rendering code and those that test the full encoding too. The first ones are not valid codes but are unique. The latter are valid but unfortunately all but unique. There's multiple valid ways to encode input text into the bit stream, and you can select how much error correction you want to have.

vkrause updated this revision to Diff 22188.Nov 11 2017, 1:27 PM

Adapt to review comments.

vkrause updated this revision to Diff 22205.Nov 11 2017, 9:57 PM

Fix off-by-one inconsistency in layerCount

It now always means the amount of layers and not the index of the last layer. Fixes rendering of the unusually short Air Baltic boarding pass data.

svuorela accepted this revision.Nov 12 2017, 9:19 PM

I like it. Though I haven't fully reviewed the bit magic and actually tested it, but the first can be fixed at a later point, and the latter I trust you on.

autotests/aztec-compact-data-0011.png
1 ↗(On Diff #21526)

Can we mark those that tests the full encoding that are valid but not unique (so that we know which ones should be updated if we change something in e.g. the error correction, and then need external validation before updating the images)

vkrause updated this revision to Diff 22559.Nov 18 2017, 10:55 AM

Separate test images into those containing only rendering/layouting data and those with full data encoding.

svuorela accepted this revision.Nov 24 2017, 9:14 PM
This revision was automatically updated to reflect the committed changes.