AZTEC: optimize populate_map (good for small data)

This commit is contained in:
gitlost 2021-05-27 18:33:19 +01:00
parent ba273b40dd
commit 0337548c77
4 changed files with 964 additions and 215 deletions

View File

@ -2,7 +2,7 @@
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2009-2020 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2009-2021 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions modification, are permitted provided that the following conditions
@ -39,11 +39,12 @@
#include "aztec.h" #include "aztec.h"
#include "reedsol.h" #include "reedsol.h"
#define AZTEC_MAX_CAPACITY 19968 /* ISO/IEC 24778:2008 5.3 Table 1 Maximum Symbol Bit Capacity */ #define AZTEC_MAX_CAPACITY 19968 /* ISO/IEC 24778:2008 5.3 Table 1 Maximum Symbol Bit Capacity */
#define AZTEC_BIN_CAPACITY 17940 /* Above less 169 * 12 = 2028 bits (169 = 10% of 1664 + 3) */ #define AZTEC_BIN_CAPACITY 17940 /* Above less 169 * 12 = 2028 bits (169 = 10% of 1664 + 3) */
#define AZTEC_MAP_SIZE 22801 /* AztecMap Version 32 151 x 151 */ #define AZTEC_MAP_SIZE 22801 /* AztecMap Version 32 151 x 151 */
#define AZTEC_MAP_POSN_MAX 20039 /* Maximum position index in AztecMap */
static int count_doubles(const unsigned char source[], int i, const int length) { static int az_count_doubles(const unsigned char source[], int i, const int length) {
int c = 0; int c = 0;
while ((i + 1 < length) && ((source[i] == '.') || (source[i] == ',')) && (source[i + 1] == ' ')) { while ((i + 1 < length) && ((source[i] == '.') || (source[i] == ',')) && (source[i + 1] == ' ')) {
@ -54,18 +55,7 @@ static int count_doubles(const unsigned char source[], int i, const int length)
return c; return c;
} }
static int count_cr(unsigned char source[], int i, const int length) { static int az_count_dotcomma(const unsigned char source[], int i, const int length) {
int c = 0;
while (i < length && source[i] == 13) {
c++;
i++;
}
return c;
}
static int count_dotcomma(unsigned char source[], int i, const int length) {
int c = 0; int c = 0;
while (i < length && ((source[i] == '.') || (source[i] == ','))) { while (i < length && ((source[i] == '.') || (source[i] == ','))) {
@ -76,10 +66,10 @@ static int count_dotcomma(unsigned char source[], int i, const int length) {
return c; return c;
} }
static int count_spaces(unsigned char source[], int i, const int length) { static int az_count_chr(const unsigned char source[], int i, const int length, const unsigned char chr) {
int c = 0; int c = 0;
while (i < length && source[i] == ' ') { while (i < length && source[i] == chr) {
c++; c++;
i++; i++;
} }
@ -87,7 +77,7 @@ static int count_spaces(unsigned char source[], int i, const int length) {
return c; return c;
} }
static char get_next_mode(char encode_mode[], const int src_len, int i) { static char az_get_next_mode(const char encode_mode[], const int src_len, int i) {
int current_mode = encode_mode[i]; int current_mode = encode_mode[i];
do { do {
@ -152,8 +142,8 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
// Combinations (. SP) and (, SP) sometimes use fewer bits in Digit mode // Combinations (. SP) and (, SP) sometimes use fewer bits in Digit mode
} else if (((source[i] == '.') || (source[i] == ',')) && (source[i + 1] == ' ') && (encode_mode[i] == 'X')) { } else if (((source[i] == '.') || (source[i] == ',')) && (source[i + 1] == ' ') && (encode_mode[i] == 'X')) {
count = count_doubles(source, i, src_len); count = az_count_doubles(source, i, src_len);
next_mode = get_next_mode(encode_mode, src_len, i); next_mode = az_get_next_mode(encode_mode, src_len, i);
if (current_mode == 'U') { if (current_mode == 'U') {
if ((next_mode == 'D') && (count <= 5)) { if ((next_mode == 'D') && (count <= 5)) {
@ -244,11 +234,11 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
reduced_length = j; reduced_length = j;
current_mode = 'U'; current_mode = 'U';
for(i = 0; i < reduced_length; i++) { for (i = 0; i < reduced_length; i++) {
// Resolve Carriage Return (CR) which can be Punct or Mixed mode // Resolve Carriage Return (CR) which can be Punct or Mixed mode
if (reduced_source[i] == 13) { if (reduced_source[i] == 13) {
count = count_cr(reduced_source, i, reduced_length); count = az_count_chr(reduced_source, i, reduced_length, 13);
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i); next_mode = az_get_next_mode(reduced_encode_mode, reduced_length, i);
if ((current_mode == 'U') && ((next_mode == 'U') || (next_mode == 'B')) && (count == 1)) { if ((current_mode == 'U') && ((next_mode == 'U') || (next_mode == 'B')) && (count == 1)) {
reduced_encode_mode[i] = 'P'; reduced_encode_mode[i] = 'P';
@ -261,7 +251,8 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
} }
if (current_mode == 'D') { if (current_mode == 'D') {
if (((next_mode == 'E') || (next_mode == 'U') || (next_mode == 'D') || (next_mode == 'B')) && (count <= 2)) { if (((next_mode == 'E') || (next_mode == 'U') || (next_mode == 'D') || (next_mode == 'B'))
&& (count <= 2)) {
for (j = 0; j < count; j++) { for (j = 0; j < count; j++) {
reduced_encode_mode[i + j] = 'P'; reduced_encode_mode[i + j] = 'P';
} }
@ -277,11 +268,12 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
// Resolve full stop and comma which can be in Punct or Digit mode // Resolve full stop and comma which can be in Punct or Digit mode
} else if ((reduced_source[i] == '.') || (reduced_source[i] == ',')) { } else if ((reduced_source[i] == '.') || (reduced_source[i] == ',')) {
count = count_dotcomma(reduced_source, i, reduced_length); count = az_count_dotcomma(reduced_source, i, reduced_length);
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i); next_mode = az_get_next_mode(reduced_encode_mode, reduced_length, i);
if (current_mode == 'U') { if (current_mode == 'U') {
if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'B')) && (count == 1)) { if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'B'))
&& (count == 1)) {
reduced_encode_mode[i] = 'P'; reduced_encode_mode[i] = 'P';
} }
@ -295,7 +287,8 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
} }
} else if (current_mode == 'M') { } else if (current_mode == 'M') {
if (((next_mode == 'E') || (next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M')) && (count <= 4)) { if (((next_mode == 'E') || (next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M'))
&& (count <= 4)) {
for (j = 0; j < count; j++) { for (j = 0; j < count; j++) {
reduced_encode_mode[i + j] = 'P'; reduced_encode_mode[i + j] = 'P';
} }
@ -318,15 +311,16 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
// Resolve Space (SP) which can be any mode except Punct // Resolve Space (SP) which can be any mode except Punct
} else if (reduced_source[i] == ' ') { } else if (reduced_source[i] == ' ') {
count = count_spaces(reduced_source, i, reduced_length); count = az_count_chr(reduced_source, i, reduced_length, ' ');
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i); next_mode = az_get_next_mode(reduced_encode_mode, reduced_length, i);
if (current_mode == 'U') { if (current_mode == 'U') {
if ((next_mode == 'E') && (count <= 5)) { if ((next_mode == 'E') && (count <= 5)) {
for (j = 0; j < count; j++) { for (j = 0; j < count; j++) {
reduced_encode_mode[i + j] = 'U'; reduced_encode_mode[i + j] = 'U';
} }
} else if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'P') || (next_mode == 'B')) && (count <= 9)) { } else if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'P')
|| (next_mode == 'B')) && (count <= 9)) {
for (j = 0; j < count; j++) { for (j = 0; j < count; j++) {
reduced_encode_mode[i + j] = 'U'; reduced_encode_mode[i + j] = 'U';
} }
@ -375,7 +369,8 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
reduced_encode_mode[i + j] = 'U'; reduced_encode_mode[i + j] = 'U';
} }
} else if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'P') || (next_mode == 'B')) && (count <= 9)) { } else if (((next_mode == 'U') || (next_mode == 'L') || (next_mode == 'M') || (next_mode == 'P')
|| (next_mode == 'B')) && (count <= 9)) {
for (j = 0; j < count; j++) { for (j = 0; j < count; j++) {
reduced_encode_mode[i + j] = 'U'; reduced_encode_mode[i + j] = 'U';
} }
@ -395,12 +390,13 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
// Decide when to use P/S instead of P/L and U/S instead of U/L // Decide when to use P/S instead of P/L and U/S instead of U/L
current_mode = 'U'; current_mode = 'U';
for(i = 0; i < reduced_length; i++) { for (i = 0; i < reduced_length; i++) {
if (reduced_encode_mode[i] != current_mode) { if (reduced_encode_mode[i] != current_mode) {
for (count = 0; ((i + count) < reduced_length) && (reduced_encode_mode[i + count] == reduced_encode_mode[i]); count++); for (count = 0; ((i + count) < reduced_length)
next_mode = get_next_mode(reduced_encode_mode, reduced_length, i); && (reduced_encode_mode[i + count] == reduced_encode_mode[i]); count++);
next_mode = az_get_next_mode(reduced_encode_mode, reduced_length, i);
if (reduced_encode_mode[i] == 'P') { if (reduced_encode_mode[i] == 'P') {
if ((current_mode == 'U') && (count <= 2)) { if ((current_mode == 'U') && (count <= 2)) {
@ -441,7 +437,8 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
reduced_encode_mode[i + j] = 'u'; reduced_encode_mode[i + j] = 'u';
} }
} else if ((current_mode == 'L') && ((next_mode == 'E') || (next_mode == 'D') || (next_mode == 'B') || (next_mode == 'P')) && (count == 1)) { } else if ((current_mode == 'L') && ((next_mode == 'E') || (next_mode == 'D') || (next_mode == 'B')
|| (next_mode == 'P')) && (count == 1)) {
reduced_encode_mode[i] = 'u'; reduced_encode_mode[i] = 'u';
} else if ((current_mode == 'D') && (next_mode == 'D') && (count == 1)) { } else if ((current_mode == 'D') && (next_mode == 'D') && (count == 1)) {
@ -681,13 +678,15 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
if (reduced_source[i] == ' ') { if (reduced_source[i] == ' ') {
if (!(bp = az_bin_append_posn(1, 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // SP if (!(bp = az_bin_append_posn(1, 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // SP
} else { } else {
if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string, bp)))
return ZINT_ERROR_TOO_LONG;
} }
} else if (reduced_encode_mode[i] == 'L') { } else if (reduced_encode_mode[i] == 'L') {
if (reduced_source[i] == ' ') { if (reduced_source[i] == ' ') {
if (!(bp = az_bin_append_posn(1, 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // SP if (!(bp = az_bin_append_posn(1, 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // SP
} else { } else {
if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string, bp)))
return ZINT_ERROR_TOO_LONG;
} }
} else if (reduced_encode_mode[i] == 'M') { } else if (reduced_encode_mode[i] == 'M') {
if (reduced_source[i] == ' ') { if (reduced_source[i] == ' ') {
@ -695,7 +694,8 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
} else if (reduced_source[i] == 13) { } else if (reduced_source[i] == 13) {
if (!(bp = az_bin_append_posn(14, 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // CR if (!(bp = az_bin_append_posn(14, 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // CR
} else { } else {
if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string, bp)))
return ZINT_ERROR_TOO_LONG;
} }
} else if ((reduced_encode_mode[i] == 'P') || (reduced_encode_mode[i] == 'p')) { } else if ((reduced_encode_mode[i] == 'P') || (reduced_encode_mode[i] == 'p')) {
if (gs1 && (reduced_source[i] == '[')) { if (gs1 && (reduced_source[i] == '[')) {
@ -716,7 +716,8 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
} else if (reduced_source[i] == '.') { } else if (reduced_source[i] == '.') {
if (!(bp = az_bin_append_posn(19, 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // Full stop if (!(bp = az_bin_append_posn(19, 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // Full stop
} else { } else {
if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string, bp))) return ZINT_ERROR_TOO_LONG; if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 5, binary_string, bp)))
return ZINT_ERROR_TOO_LONG;
} }
} else if (reduced_encode_mode[i] == 'D') { } else if (reduced_encode_mode[i] == 'D') {
if (reduced_source[i] == ' ') { if (reduced_source[i] == ' ') {
@ -726,7 +727,8 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
} else if (reduced_source[i] == '.') { } else if (reduced_source[i] == '.') {
if (!(bp = az_bin_append_posn(13, 4, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // Full stop if (!(bp = az_bin_append_posn(13, 4, binary_string, bp))) return ZINT_ERROR_TOO_LONG; // Full stop
} else { } else {
if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 4, binary_string, bp))) return ZINT_ERROR_TOO_LONG; if (!(bp = az_bin_append_posn(AztecSymbolChar[(int) reduced_source[i]], 4, binary_string, bp)))
return ZINT_ERROR_TOO_LONG;
} }
} else if (reduced_encode_mode[i] == 'B') { } else if (reduced_encode_mode[i] == 'B') {
if (!(bp = az_bin_append_posn(reduced_source[i], 8, binary_string, bp))) return ZINT_ERROR_TOO_LONG; if (!(bp = az_bin_append_posn(reduced_source[i], 8, binary_string, bp))) return ZINT_ERROR_TOO_LONG;
@ -744,7 +746,7 @@ static int aztec_text_process(const unsigned char source[], int src_len, char bi
} }
/* Prevent data from obscuring reference grid */ /* Prevent data from obscuring reference grid */
static int avoidReferenceGrid(int output) { static int az_avoidReferenceGrid(int output) {
if (output > 10) { if (output > 10) {
output += (output - 11) / 15 + 1; output += (output - 11) / 15 + 1;
@ -753,128 +755,88 @@ static int avoidReferenceGrid(int output) {
return output; return output;
} }
/* Calculate the position of the bits in the grid */ /* Calculate the position of the bits in the grid (non-compact) */
static void populate_map(short AztecMap[]) { static void az_populate_map(short AztecMap[], const int layers) {
int layer, n, i; int layer, n, i;
int x, y; int x, y;
const int offset = AztecOffset[layers - 1];
const int endoffset = 151 - offset;
memset(AztecMap, 0, sizeof(short) * AZTEC_MAP_SIZE); for (layer = 0; layer < layers; layer++) {
const int start = (112 * layer) + (16 * layer * layer) + 2;
for (layer = 1; layer < 33; layer++) { const int length = 28 + (layer * 4) + (layer + 1) * 4;
const int start = (112 * (layer - 1)) + (16 * (layer - 1) * (layer - 1)) + 2; int av0, av1;
const int length = 28 + ((layer - 1) * 4) + (layer * 4);
/* Top */ /* Top */
i = 0; i = 0;
x = 64 - ((layer - 1) * 2); x = 64 - (layer * 2);
y = 63 - ((layer - 1) * 2); y = 63 - (layer * 2);
av0 = az_avoidReferenceGrid(y) * 151;
av1 = az_avoidReferenceGrid(y - 1) * 151;
for (n = start; n < (start + length); n += 2) { for (n = start; n < (start + length); n += 2) {
AztecMap[(avoidReferenceGrid(y) * 151) + avoidReferenceGrid(x + i)] = n; int avxi = az_avoidReferenceGrid(x + i);
AztecMap[(avoidReferenceGrid(y - 1) * 151) + avoidReferenceGrid(x + i)] = n + 1; AztecMap[av0 + avxi] = n;
AztecMap[av1 + avxi] = n + 1;
i++; i++;
} }
/* Right */ /* Right */
i = 0; i = 0;
x = 78 + ((layer - 1) * 2); x = 78 + (layer * 2);
y = 64 - ((layer - 1) * 2); y = 64 - (layer * 2);
av0 = az_avoidReferenceGrid(x);
av1 = az_avoidReferenceGrid(x + 1);
for (n = start + length; n < (start + (length * 2)); n += 2) { for (n = start + length; n < (start + (length * 2)); n += 2) {
AztecMap[(avoidReferenceGrid(y + i) * 151) + avoidReferenceGrid(x)] = n; int avyi = az_avoidReferenceGrid(y + i) * 151;
AztecMap[(avoidReferenceGrid(y + i) * 151) + avoidReferenceGrid(x + 1)] = n + 1; AztecMap[avyi + av0] = n;
AztecMap[avyi + av1] = n + 1;
i++; i++;
} }
/* Bottom */ /* Bottom */
i = 0; i = 0;
x = 77 + ((layer - 1) * 2); x = 77 + (layer * 2);
y = 78 + ((layer - 1) * 2); y = 78 + (layer * 2);
av0 = az_avoidReferenceGrid(y) * 151;
av1 = az_avoidReferenceGrid(y + 1) * 151;
for (n = start + (length * 2); n < (start + (length * 3)); n += 2) { for (n = start + (length * 2); n < (start + (length * 3)); n += 2) {
AztecMap[(avoidReferenceGrid(y) * 151) + avoidReferenceGrid(x - i)] = n; int avxi = az_avoidReferenceGrid(x - i);
AztecMap[(avoidReferenceGrid(y + 1) * 151) + avoidReferenceGrid(x - i)] = n + 1; AztecMap[av0 + avxi] = n;
AztecMap[av1 + avxi] = n + 1;
i++; i++;
} }
/* Left */ /* Left */
i = 0; i = 0;
x = 63 - ((layer - 1) * 2); x = 63 - (layer * 2);
y = 77 + ((layer - 1) * 2); y = 77 + (layer * 2);
av0 = az_avoidReferenceGrid(x);
av1 = az_avoidReferenceGrid(x - 1);
for (n = start + (length * 3); n < (start + (length * 4)); n += 2) { for (n = start + (length * 3); n < (start + (length * 4)); n += 2) {
AztecMap[(avoidReferenceGrid(y - i) * 151) + avoidReferenceGrid(x)] = n; int avyi = az_avoidReferenceGrid(y - i) * 151;
AztecMap[(avoidReferenceGrid(y - i) * 151) + avoidReferenceGrid(x - 1)] = n + 1; AztecMap[avyi + av0] = n;
AztecMap[avyi + av1] = n + 1;
i++; i++;
} }
} }
/* Central finder pattern */ /* Copy "Core Symbol" (finder, descriptor, orientation) */
for (y = 69; y <= 81; y++) { for (y = 0; y < 15; y++) {
for (x = 69; x <= 81; x++) { memcpy(AztecMap + (y + 68) * 151 + 68, AztecMapCore[y], sizeof(short) * 15);
AztecMap[(x * 151) + y] = 1;
}
}
for (y = 70; y <= 80; y++) {
for (x = 70; x <= 80; x++) {
AztecMap[(x * 151) + y] = 0;
}
}
for (y = 71; y <= 79; y++) {
for (x = 71; x <= 79; x++) {
AztecMap[(x * 151) + y] = 1;
}
}
for (y = 72; y <= 78; y++) {
for (x = 72; x <= 78; x++) {
AztecMap[(x * 151) + y] = 0;
}
}
for (y = 73; y <= 77; y++) {
for (x = 73; x <= 77; x++) {
AztecMap[(x * 151) + y] = 1;
}
}
for (y = 74; y <= 76; y++) {
for (x = 74; x <= 76; x++) {
AztecMap[(x * 151) + y] = 0;
}
} }
/* Guide bars */ /* Reference grid guide bars */
for (y = 11; y < 151; y += 16) { for (y = offset <= 11 ? 11 : AztecMapGridYOffsets[(offset - 11) / 16]; y < endoffset; y += 16) {
for (x = 1; x < 151; x += 2) { for (x = offset; x < endoffset; x++) {
AztecMap[(x * 151) + y] = 1; AztecMap[(x * 151) + y] = x & 1;
AztecMap[(y * 151) + x] = 1; AztecMap[(y * 151) + x] = x & 1;
} }
} }
/* Descriptor */
for (i = 0; i < 10; i++) {
/* Top */
AztecMap[(avoidReferenceGrid(64) * 151) + avoidReferenceGrid(66 + i)] = 20000 + i;
}
for (i = 0; i < 10; i++) {
/* Right */
AztecMap[(avoidReferenceGrid(66 + i) * 151) + avoidReferenceGrid(77)] = 20010 + i;
}
for (i = 0; i < 10; i++) {
/* Bottom */
AztecMap[(avoidReferenceGrid(77) * 151) + avoidReferenceGrid(75 - i)] = 20020 + i;
}
for (i = 0; i < 10; i++) {
/* Left */
AztecMap[(avoidReferenceGrid(75 - i) * 151) + avoidReferenceGrid(64)] = 20030 + i;
}
/* Orientation */
AztecMap[(avoidReferenceGrid(64) * 151) + avoidReferenceGrid(64)] = 1;
AztecMap[(avoidReferenceGrid(65) * 151) + avoidReferenceGrid(64)] = 1;
AztecMap[(avoidReferenceGrid(64) * 151) + avoidReferenceGrid(65)] = 1;
AztecMap[(avoidReferenceGrid(64) * 151) + avoidReferenceGrid(77)] = 1;
AztecMap[(avoidReferenceGrid(65) * 151) + avoidReferenceGrid(77)] = 1;
AztecMap[(avoidReferenceGrid(76) * 151) + avoidReferenceGrid(77)] = 1;
} }
INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int length) { INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int length) {
int x, y, i, j, p, data_blocks, ecc_blocks, layers, total_bits; int x, y, i, j, p, data_blocks, ecc_blocks, layers, total_bits;
char bit_pattern[20045]; /* Note 20045 > AZTEC_BIN_CAPACITY + 1 */ char bit_pattern[AZTEC_MAP_POSN_MAX + 1]; /* Note AZTEC_MAP_POSN_MAX > AZTEC_BIN_CAPACITY */
/* To lessen stack usage, share binary_string buffer with bit_pattern, as accessed separately */ /* To lessen stack usage, share binary_string buffer with bit_pattern, as accessed separately */
char *binary_string = bit_pattern; char *binary_string = bit_pattern;
char descriptor[42]; char descriptor[42];
char adjusted_string[AZTEC_MAX_CAPACITY + 1]; char adjusted_string[AZTEC_MAX_CAPACITY];
short AztecMap[AZTEC_MAP_SIZE]; short AztecMap[AZTEC_MAP_SIZE];
unsigned char desc_data[4], desc_ecc[6]; unsigned char desc_data[4], desc_ecc[6];
int error_number, ecc_level, compact, data_length, data_maxsize, codeword_size, adjusted_length; int error_number, ecc_level, compact, data_length, data_maxsize, codeword_size, adjusted_length;
@ -889,8 +851,7 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
unsigned int* ecc_part; unsigned int* ecc_part;
#endif #endif
memset(binary_string, 0, AZTEC_BIN_CAPACITY + 1); memset(adjusted_string, 0, AZTEC_MAX_CAPACITY);
memset(adjusted_string, 0, AZTEC_MAX_CAPACITY + 1);
if ((symbol->input_mode & 0x07) == GS1_MODE) { if ((symbol->input_mode & 0x07) == GS1_MODE) {
gs1 = 1; gs1 = 1;
@ -906,8 +867,6 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
return ZINT_ERROR_INVALID_OPTION; return ZINT_ERROR_INVALID_OPTION;
} }
populate_map(AztecMap);
error_number = aztec_text_process(source, length, binary_string, gs1, symbol->eci, &data_length, debug); error_number = aztec_text_process(source, length, binary_string, gs1, symbol->eci, &data_length, debug);
if (error_number != 0) { if (error_number != 0) {
@ -1044,7 +1003,6 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
adjusted_string[j] = binary_string[i]; adjusted_string[j] = binary_string[i];
j++; j++;
} }
adjusted_string[j] = '\0';
adjusted_length = j; adjusted_length = j;
adjustment_size = adjusted_length - data_length; adjustment_size = adjusted_length - data_length;
@ -1059,7 +1017,6 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
for (i = 0; i < padbits; i++) { for (i = 0; i < padbits; i++) {
adjusted_string[adjusted_length++] = '1'; adjusted_string[adjusted_length++] = '1';
} }
adjusted_string[adjusted_length] = '\0';
count = 0; count = 0;
for (i = (adjusted_length - codeword_size); i < adjusted_length; i++) { for (i = (adjusted_length - codeword_size); i < adjusted_length; i++) {
@ -1137,7 +1094,6 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
adjusted_string[j] = binary_string[i]; adjusted_string[j] = binary_string[i];
j++; j++;
} }
adjusted_string[j] = '\0';
adjusted_length = j; adjusted_length = j;
remainder = adjusted_length % codeword_size; remainder = adjusted_length % codeword_size;
@ -1150,7 +1106,6 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
for (i = 0; i < padbits; i++) { for (i = 0; i < padbits; i++) {
adjusted_string[adjusted_length++] = '1'; adjusted_string[adjusted_length++] = '1';
} }
adjusted_string[adjusted_length] = '\0';
count = 0; count = 0;
for (i = (adjusted_length - codeword_size); i < adjusted_length; i++) { for (i = (adjusted_length - codeword_size); i < adjusted_length; i++) {
@ -1201,13 +1156,7 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
} }
if (debug) { if (debug) {
printf("Generating a "); printf("Generating a %s symbol with %d layers\n", compact ? "compact" : "full-size", layers);
if (compact) {
printf("compact");
} else {
printf("full-size");
}
printf(" symbol with %d layers\n", layers);
printf("Requires "); printf("Requires ");
if (compact) { if (compact) {
printf("%d", AztecCompactSizes[layers - 1]); printf("%d", AztecCompactSizes[layers - 1]);
@ -1219,14 +1168,14 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
} }
#ifndef _MSC_VER #ifndef _MSC_VER
unsigned int data_part[data_blocks + 3], ecc_part[ecc_blocks + 3]; unsigned int data_part[data_blocks], ecc_part[ecc_blocks];
#else #else
data_part = (unsigned int*) _alloca((data_blocks + 3) * sizeof (unsigned int)); data_part = (unsigned int *) _alloca(sizeof(unsigned int) * data_blocks);
ecc_part = (unsigned int*) _alloca((ecc_blocks + 3) * sizeof (unsigned int)); ecc_part = (unsigned int *) _alloca(sizeof(unsigned int) * ecc_blocks);
#endif #endif
/* Copy across data into separate integers */ /* Copy across data into separate integers */
memset(data_part, 0, (data_blocks + 2) * sizeof (int)); memset(data_part, 0, sizeof(unsigned int) * data_blocks);
memset(ecc_part, 0, (ecc_blocks + 2) * sizeof (int)); memset(ecc_part, 0, sizeof(unsigned int) * ecc_blocks);
/* Split into codewords and calculate reed-solomon error correction codes */ /* Split into codewords and calculate reed-solomon error correction codes */
for (i = 0; i < data_blocks; i++) { for (i = 0; i < data_blocks; i++) {
@ -1267,7 +1216,7 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
} }
/* Invert the data so that actual data is on the outside and reed-solomon on the inside */ /* Invert the data so that actual data is on the outside and reed-solomon on the inside */
memset(bit_pattern, '0', 20045); memset(bit_pattern, '0', AZTEC_MAP_POSN_MAX + 1);
total_bits = (data_blocks + ecc_blocks) * codeword_size; total_bits = (data_blocks + ecc_blocks) * codeword_size;
for (i = 0; i < total_bits; i++) { for (i = 0; i < total_bits; i++) {
@ -1309,9 +1258,7 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
descriptor[i] = '0'; descriptor[i] = '0';
} }
} }
if (debug) printf("Mode Message = %.8s\n", descriptor);
descriptor[8] = '\0';
if (debug) printf("Mode Message = %s\n", descriptor);
} else { } else {
/* The first 5 bits represent the number of layers minus 1 */ /* The first 5 bits represent the number of layers minus 1 */
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
@ -1339,8 +1286,7 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
descriptor[i] = '0'; descriptor[i] = '0';
} }
} }
descriptor[16] = '\0'; if (debug) printf("Mode Message = %.16s\n", descriptor);
if (debug) printf("Mode Message = %s\n", descriptor);
} }
/* Split into 4-bit codewords */ /* Split into 4-bit codewords */
@ -1416,12 +1362,10 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
} }
/* Merge descriptor with the rest of the symbol */ /* Merge descriptor with the rest of the symbol */
for (i = 0; i < 40; i++) { if (compact) {
if (compact) { memcpy(bit_pattern + 2000 - 2, descriptor, 40);
bit_pattern[2000 + i - 2] = descriptor[i]; } else {
} else { memcpy(bit_pattern + 20000 - 2, descriptor, 40);
bit_pattern[20000 + i - 2] = descriptor[i];
}
} }
/* Plot all of the data into the symbol in pre-defined spiral pattern */ /* Plot all of the data into the symbol in pre-defined spiral pattern */
@ -1434,10 +1378,8 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
int map = CompactAztecMap[y_map + x]; int map = CompactAztecMap[y_map + x];
if (map == 1) { if (map == 1) {
set_module(symbol, y - offset, x - offset); set_module(symbol, y - offset, x - offset);
} else if (map >= 2) { } else if (map >= 2 && bit_pattern[map - 2] == '1') {
if (bit_pattern[map - 2] == '1') { set_module(symbol, y - offset, x - offset);
set_module(symbol, y - offset, x - offset);
}
} }
} }
symbol->row_height[y - offset] = 1; symbol->row_height[y - offset] = 1;
@ -1447,16 +1389,15 @@ INTERNAL int aztec(struct zint_symbol *symbol, unsigned char source[], int lengt
} else { } else {
int offset = AztecOffset[layers - 1]; int offset = AztecOffset[layers - 1];
int end_offset = 151 - offset; int end_offset = 151 - offset;
az_populate_map(AztecMap, layers);
for (y = offset; y < end_offset; y++) { for (y = offset; y < end_offset; y++) {
int y_map = y * 151; int y_map = y * 151;
for (x = offset; x < end_offset; x++) { for (x = offset; x < end_offset; x++) {
int map = AztecMap[y_map + x]; int map = AztecMap[y_map + x];
if (map == 1) { if (map == 1) {
set_module(symbol, y - offset, x - offset); set_module(symbol, y - offset, x - offset);
} else if (map >= 2) { } else if (map >= 2 && bit_pattern[map - 2] == '1') {
if (bit_pattern[map - 2] == '1') { set_module(symbol, y - offset, x - offset);
set_module(symbol, y - offset, x - offset);
}
} }
} }
symbol->row_height[y - offset] = 1; symbol->row_height[y - offset] = 1;
@ -1535,11 +1476,8 @@ INTERNAL int aztec_runes(struct zint_symbol *symbol, unsigned char source[], int
for (x = 8; x < 19; x++) { for (x = 8; x < 19; x++) {
if (CompactAztecMap[r + x] == 1) { if (CompactAztecMap[r + x] == 1) {
set_module(symbol, y - 8, x - 8); set_module(symbol, y - 8, x - 8);
} } else if (CompactAztecMap[r + x] >= 2 && binary_string[CompactAztecMap[r + x] - 2000] == '1') {
if (CompactAztecMap[r + x] >= 2) { set_module(symbol, y - 8, x - 8);
if (binary_string[CompactAztecMap[r + x] - 2000] == '1') {
set_module(symbol, y - 8, x - 8);
}
} }
} }
symbol->row_height[y - 8] = 1; symbol->row_height[y - 8] = 1;

View File

@ -1,8 +1,8 @@
/* aztec.c - Handles Aztec Mesa 2D Symbols */ /* aztec.h - Handles Aztec 2D Symbols */
/* /*
libzint - the open source barcode library libzint - the open source barcode library
Copyright (C) 2008-2017 Robin Stuart <rstuart114@gmail.com> Copyright (C) 2008-2021 Robin Stuart <rstuart114@gmail.com>
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions modification, are permitted provided that the following conditions
@ -29,15 +29,11 @@
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
*/ */
/* vim: set ts=4 sw=4 et : */
#ifndef __AZTEC_H
#define __AZTEC_H
#define UPPER 1 static const short CompactAztecMap[] = {
#define LOWER 2
#define MIXED 4
#define PUNC 8
#define DIGIT 16
#define BINARY 32
static const unsigned short int CompactAztecMap[] = {
/* 27 x 27 data grid */ /* 27 x 27 data grid */
609, 608, 411, 413, 415, 417, 419, 421, 423, 425, 427, 429, 431, 433, 435, 437, 439, 441, 443, 445, 447, 449, 451, 453, 455, 457, 459, 609, 608, 411, 413, 415, 417, 419, 421, 423, 425, 427, 429, 431, 433, 435, 437, 439, 441, 443, 445, 447, 449, 451, 453, 455, 457, 459,
607, 606, 410, 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458, 607, 606, 410, 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458,
@ -68,6 +64,25 @@ static const unsigned short int CompactAztecMap[] = {
559, 557, 555, 553, 551, 549, 547, 545, 543, 541, 539, 537, 535, 533, 531, 529, 527, 525, 523, 521, 519, 517, 515, 513, 511, 508, 509 559, 557, 555, 553, 551, 549, 547, 545, 543, 541, 539, 537, 535, 533, 531, 529, 527, 525, 523, 521, 519, 517, 515, 513, 511, 508, 509
}; };
/* Pre-calculated finder, descriptor, orientation mappings for full-range symbol */
static const short AztecMapCore[15][15] = {
{ 1, 1, 20000, 20001, 20002, 20003, 20004, 0, 20005, 20006, 20007, 20008, 20009, 0, 1, },
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
{ 20039, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 20010, },
{ 20038, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 20011, },
{ 20037, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 20012, },
{ 20036, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 20013, },
{ 20035, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 20014, },
{ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, },
{ 20034, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 20015, },
{ 20033, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 20016, },
{ 20032, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 20017, },
{ 20031, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 20018, },
{ 20030, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 20019, },
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
{ 0, 0, 20029, 20028, 20027, 20026, 20025, 0, 20024, 20023, 20022, 20021, 20020, 0, 0, },
};
static const char AztecSymbolChar[128] = { static const char AztecSymbolChar[128] = {
/* From Table 2 */ /* From Table 2 */
0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 14, 15, 16, 17, 18, 19, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 14, 15, 16, 17, 18, 19,
@ -81,57 +96,57 @@ static const char AztecSymbolChar[128] = {
static const char AztecModes[129] = "BMMMMMMMMMMMMXBBBBBBBBBBBBBMMMMMXPPPPPPPPPPPXPXPDDDDDDDDDDPPPPPPMUUUUUUUUUUUUUUUUUUUUUUUUUUPMPMMMLLLLLLLLLLLLLLLLLLLLLLLLLLPMPMM"; static const char AztecModes[129] = "BMMMMMMMMMMMMXBBBBBBBBBBBBBMMMMMXPPPPPPPPPPPXPXPDDDDDDDDDDPPPPPPMUUUUUUUUUUUUUUUUUUUUUUUUUUPMPMMMLLLLLLLLLLLLLLLLLLLLLLLLLLPMPMM";
static const unsigned short int AztecSizes[32] = { static const short AztecSizes[32] = {
/* Codewords per symbol */ /* Codewords per symbol */
21, 48, 60, 88, 120, 156, 196, 240, 230, 272, 316, 364, 416, 470, 528, 588, 652, 720, 790, 21, 48, 60, 88, 120, 156, 196, 240, 230, 272, 316, 364, 416, 470, 528, 588, 652, 720, 790,
864, 940, 1020, 920, 992, 1066, 1144, 1224, 1306, 1392, 1480, 1570, 1664 864, 940, 1020, 920, 992, 1066, 1144, 1224, 1306, 1392, 1480, 1570, 1664
}; };
static const int AztecCompactSizes[4] = { static const short AztecCompactSizes[4] = {
17, 40, 51, 76 17, 40, 51, 76
}; };
static const unsigned short int Aztec10DataSizes[32] = { static const short Aztec10DataSizes[32] = {
/* Data bits per symbol maximum with 10% error correction */ /* Data bits per symbol maximum with 10% error correction */
96, 246, 408, 616, 840, 1104, 1392, 1704, 2040, 2420, 2820, 3250, 3720, 4200, 4730, 96, 246, 408, 616, 840, 1104, 1392, 1704, 2040, 2420, 2820, 3250, 3720, 4200, 4730,
5270, 5840, 6450, 7080, 7750, 8430, 9150, 9900, 10680, 11484, 12324, 13188, 14076, 5270, 5840, 6450, 7080, 7750, 8430, 9150, 9900, 10680, 11484, 12324, 13188, 14076,
15000, 15948, 16920, 17940 15000, 15948, 16920, 17940
}; };
static const unsigned short int Aztec23DataSizes[32] = { static const short Aztec23DataSizes[32] = {
/* Data bits per symbol maximum with 23% error correction */ /* Data bits per symbol maximum with 23% error correction */
84, 204, 352, 520, 720, 944, 1184, 1456, 1750, 2070, 2410, 2780, 3180, 3590, 4040, 84, 204, 352, 520, 720, 944, 1184, 1456, 1750, 2070, 2410, 2780, 3180, 3590, 4040,
4500, 5000, 5520, 6060, 6630, 7210, 7830, 8472, 9132, 9816, 10536, 11280, 12036, 4500, 5000, 5520, 6060, 6630, 7210, 7830, 8472, 9132, 9816, 10536, 11280, 12036,
12828, 13644, 14472, 15348 12828, 13644, 14472, 15348
}; };
static const unsigned short int Aztec36DataSizes[32] = { static const short Aztec36DataSizes[32] = {
/* Data bits per symbol maximum with 36% error correction */ /* Data bits per symbol maximum with 36% error correction */
66, 168, 288, 432, 592, 776, 984, 1208, 1450, 1720, 2000, 2300, 2640, 2980, 3350, 66, 168, 288, 432, 592, 776, 984, 1208, 1450, 1720, 2000, 2300, 2640, 2980, 3350,
3740, 4150, 4580, 5030, 5500, 5990, 6500, 7032, 7584, 8160, 8760, 9372, 9996, 10656, 3740, 4150, 4580, 5030, 5500, 5990, 6500, 7032, 7584, 8160, 8760, 9372, 9996, 10656,
11340, 12024, 12744 11340, 12024, 12744
}; };
static const unsigned short int Aztec50DataSizes[32] = { static const short Aztec50DataSizes[32] = {
/* Data bits per symbol maximum with 50% error correction */ /* Data bits per symbol maximum with 50% error correction */
48, 126, 216, 328, 456, 600, 760, 936, 1120, 1330, 1550, 1790, 2050, 2320, 2610, 48, 126, 216, 328, 456, 600, 760, 936, 1120, 1330, 1550, 1790, 2050, 2320, 2610,
2910, 3230, 3570, 3920, 4290, 4670, 5070, 5484, 5916, 6360, 6828, 7308, 7800, 8316, 2910, 3230, 3570, 3920, 4290, 4670, 5070, 5484, 5916, 6360, 6828, 7308, 7800, 8316,
8844, 9384, 9948 8844, 9384, 9948
}; };
static const unsigned short int AztecCompact10DataSizes [4] = { static const short AztecCompact10DataSizes[4] = {
78, 198, 336, 520 78, 198, 336, 520
}; };
static const unsigned short int AztecCompact23DataSizes [4] = { static const short AztecCompact23DataSizes[4] = {
66, 168, 288, 440 66, 168, 288, 440
}; };
static const unsigned short int AztecCompact36DataSizes [4] = { static const short AztecCompact36DataSizes[4] = {
48, 138, 232, 360 48, 138, 232, 360
}; };
static const unsigned short int AztecCompact50DataSizes [4] = { static const short AztecCompact50DataSizes[4] = {
36, 102, 176, 280 36, 102, 176, 280
}; };
@ -144,3 +159,8 @@ static const char AztecCompactOffset[4] = {
6, 4, 2, 0 6, 4, 2, 0
}; };
static const short AztecMapGridYOffsets[] = {
27, 43, 59, 75, 91, 107, 123, 139
};
#endif /* __AZTEC_H */

View File

@ -1253,7 +1253,797 @@ static void test_encode(int index, int generate, int debug) {
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"10111010011101110010010111100011101001001011100010101101110000011000110101000011100000011000101000101010001110100000000100101100001" "10111010011101110010010111100011101001001011100010101101110000011000110101000011100000011000101000101010001110100000000100101100001"
}, },
/* 30*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "0", -1, 0, 11, 11, 1, "ISO/IEC 24778:2008 Figure A.1 (1st)", /* 30*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 6, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 23, 23, 1, "Full 2 layers example",
"00000100110001011110010"
"01111011110100100101111"
"00001011010000010011001"
"00100010100111000001110"
"11011100001000000011000"
"00001111111111111110101"
"10101100000000000101011"
"00111101111111110111111"
"01101101000000010100101"
"01110101011111010110001"
"00110101010001010100110"
"01010101010101010101010"
"11111101010001010110111"
"00100101011111010101101"
"01110101000000010111101"
"11000101111111110100000"
"01010100000000000100110"
"00110111111111111110111"
"00110011101001010001110"
"10110101100101100001001"
"01011101000010010010001"
"11001100111110110000000"
"00011010100010111001011"
},
/* 31*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 7, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", -1, 0, 27, 27, 1, "Full 3 layers example",
"001011111011101010010010000"
"011111001111111001111010110"
"001111101101101100001011101"
"000111010111111110001101000"
"110110011001101010110001111"
"000101101010111110111000100"
"101010110001000000001011000"
"000110111111111111111111010"
"010000010000000000010100000"
"010000110111111111011001011"
"000000110100000001010010101"
"110100110101111101010010110"
"000110110101000101011011010"
"010101010101010101010101010"
"010100010101000101011100011"
"111100110101111101010001010"
"010001110100000001010101101"
"000100010111111111011111110"
"000000110000000000011011000"
"101100011111111111111111111"
"010101000110000010100001111"
"011011100110110000101110010"
"010100100000000000010000110"
"000010001010110110001101111"
"101110000100101100101000001"
"110011110110011010110100110"
"101010010111000001000111010"
},
/* 32*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 8, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNO", -1, 0, 31, 31, 1, "Full 4 layers example",
"0011101110100110101001010110000"
"0110000101110011101111001100111"
"0000011000110010000001101101001"
"0000001011011011101101001001100"
"1110010001100000000001110010100"
"0011000011010111111111101010010"
"1010011101100110010010100000111"
"0010000010100111010110001111110"
"0101011111000110000000111001000"
"0111110111111111111111101101111"
"0011011011000000000001011111100"
"1101110111011111111101100010110"
"0001101001010000000101110101010"
"0100001101010111110101000100100"
"1101100001010100010101011001001"
"0101010101010101010101010101010"
"0100001001010100010101110011000"
"0011110111010111110101011001111"
"0001011011010000000101010010000"
"1001110101011111111101110111000"
"0111100111000000000001111101110"
"0101000001111111111111110011100"
"0110100100101100000010011001011"
"0001111100111001110001110100001"
"1011000010001110101000011000010"
"1100010011010111001000010010010"
"0111011000111100110110011000111"
"1000111101100011010111010010010"
"0001111001001110001001100111001"
"1111011001010111010011101111110"
"1001011100001000011100011001100"
},
/* 33*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 9, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 37, 37, 1, "5 layers example",
"0010010100110011001011100010000111101"
"0101111010111110110100101101010011001"
"1010101010101010101010101010101010101"
"0001001001000101010011001101011011010"
"0011101000110101001111010000001100110"
"1101110001001110100000000100100100011"
"0011111110001101101110101010000111100"
"1001101001001001100100011011010100001"
"0011101111010010101101011010101010110"
"0100000100110001010001101101000010011"
"0111111000100111111111110000101010101"
"0001001100111001000000000110001010000"
"1110100111011111111111111110101011110"
"0000110010111000000000001100101000010"
"0110110010001011111111101010000100110"
"1100111110001010000000101000011111001"
"0110010100101010111110101011011011100"
"0001000100101010100010101000101100000"
"1010101010101010101010101010101010101"
"0001010101101010100010101001001011010"
"1011011000101010111110101011111101111"
"0101000110001010000000101100101011010"
"0110100111111011111111101110110100100"
"0100101110001000000000001110010001011"
"0011000111101111111111111111101101100"
"1001110101100010000100100011111010010"
"1111011001101110001110011101111010110"
"0100101111001010110011000101110111000"
"1010010110011001011001001101100111101"
"0000001100011000010110011000001101000"
"1110010010110101111001110110100101111"
"0100100011100010100010110111000100000"
"0111111101000100101011001011111000100"
"1100001100101101000100111000110110010"
"1010101010101010101010101010101010101"
"0101001010110100110101111101011110000"
"0111100001000111001011001100101001111"
},
/* 34*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 12, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 49, 49, 1, "8 layers example",
"0001000111011100100000001101000011110011100000101"
"0110100001000100011100000000110110101100010111110"
"0000011110010100101100001010000010000100110110111"
"0010100100100011101001100011101110100000001100111"
"1101110011111100000010101100111100100000101101011"
"0000101100100011001001000001100111010011010110101"
"1010000011100101011110011101101101010000100001110"
"0010001100111110101001000110100111001101011101110"
"1010101010101010101010101010101010101010101010101"
"0110001000111011110001110011101110001010001110111"
"0111011011101100000011101100110100100001110010110"
"0010101101101011110010100101110101110000001001001"
"1110111011000011001011011100011100110110100000010"
"0001001001100011000110100100000011100110010101100"
"0111010011110000000100011010101101010101111000011"
"1111101000111011000011110100001011011110000010011"
"0101101011101100110100101101111110001100111110010"
"0011110101011011111001110000000100000100001101010"
"0010100111011111011111111111111100100110100001011"
"1011110000101110001000000000001110100111011101101"
"0111111111110000111011111111101010011001101110110"
"0100110101101001011010000000101010110100011011010"
"0111010111000111001010111110101000110111110011110"
"0000010000100101101010100010101010110010001011101"
"1010101010101010101010101010101010101010101010101"
"1000110000111010011010100010101011100100010010101"
"1101000110010010111010111110101001100111101100011"
"0111001100100011001010000000101010111010001100100"
"1010100110000111111011111111101000000000110001110"
"0001100000100111001000000000001100101001001001110"
"1101011111000000101111111111111111011011101010101"
"0100110001000011100000110000010010100110010010010"
"0101111010111100010000001100100000101101111011100"
"1111111100101100010000010001101110000001010111110"
"0010100010100110111100011011110111101011110110000"
"1101100101100001111101000011010111011101001000101"
"1100101111001010110100001110010010111000101100111"
"1001111000101110001011010010000110011111010101011"
"0001010010010001101011101001100111100100100001100"
"0100110000100100010010110011010011110110010110111"
"1010101010101010101010101010101010101010101010101"
"0000111101100010110011110010010010110010000110110"
"0101001110100101001010111000010110011100101111010"
"1011111101011011100000000101100101100001000111111"
"0100111010000100000101011110011011011000110111000"
"0100110000101001100111000101110010010101000010001"
"0001011010100111000000011110001110011101100100110"
"1001110101111010111101010001000110101110000111011"
"1110001110011001010011001001010000100100101000001"
},
/* 35*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 14, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 57, 57, 1, "10 layers example",
"001011000011100111111010110111010001110110001110011100010"
"011110001010001111111111000000100000100100110001001011111"
"000101001001111111010111010010011011111011101011010110010"
"001101001101010110010000101100001011010000100010101001010"
"110001110000100110110111101011101101110111111011110011111"
"001000001010001001111110010100110111010100100001000011101"
"100001100100100100110111010110110100110010011100001101101"
"001101001011000011101110000100000100000010010010010011111"
"011010010000100000010101010111100000101011111001010001101"
"010101110001000111000100011100100000001010100111111111101"
"001000010011100111010010111111101001000111011011001010010"
"110110010100001100010010111100010100000100110010111111110"
"101010101010101010101010101010101010101010101010101010101"
"000011000011011100011001111001000100110110100100000101111"
"010001011111111010000110010111100100011000111001000010011"
"111110001100011000101110011000010001010000100000110100000"
"011101100010110100110111100011100101110011001100011010100"
"001111001101010010010000110100011110110011000001001010011"
"000000100001101001111001110110100111101010011010001101110"
"100010010100001011110100111000010101011011100010101001101"
"010000111011111110010010000110100100010110001101011100010"
"010101001000001101101110100100000001011011100000101100100"
"010001101110111011011111111111111111100111001110100011100"
"000111111110010000100010000000000010111001110001101111000"
"101110110001111001000110111111111011110001101101000000000"
"110000011101010010110010100000001011100000100010001111001"
"011000110110100111011010101111101010110101011111001101111"
"101110101010000100001010101000101010110000100111110010101"
"101010101010101010101010101010101010101010101010101010101"
"001110101111000000001110101000101011010110100000100110100"
"110001010000101101111010101111101010101001111111111010111"
"010100001011011110011110100000001010011100000011010010101"
"010110011010100011111010111111111010101101011101101101110"
"111101011000010010111010000000000011111101000001000100110"
"000001110011110000101011111111111111110010101110000001011"
"110100010110010111100001001100100100000011100101111110010"
"110010010101100101010010101010100110011100101011110111001"
"100001110011010011101111010101001101110111010010011100010"
"001101100101101011110101110011100101010111111101111110000"
"011110100011001000111101011000010101010010100100011010011"
"000000110100110010011000010111011101110001101010001010011"
"011010010000000101100101111001011001011101100110110100110"
"101001111101100101111011010110001101000011001101001011110"
"011000110011010000100110011001100010010001100000101100111"
"101010101010101010101010101010101010101010101010101010101"
"011101000001000000101010010000100101010101100110001110101"
"000101110010111001100111111010101010011111011001100000110"
"111001011110011010010100010100001100010001000101011010010"
"100001011011111001111111000110000001110010001101010011010"
"101110010110000110111100011101011110001110010101010010101"
"011110101000111011101001001111000010010010011010000111001"
"010000111011011100110010000000000010100001110010001010011"
"011001011001111000000000110111101001000100111000010010000"
"101000000111010010001110010001011111010011100001011110110"
"110000001000101001010101111011101111111000111011110111010"
"111101011110010100100011010101100011100110010111011001001"
"001100101001110000101000010011000100001101011001011100010"
},
/* 36*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 16, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 67, 67, 1, "12 layers example",
"0000000100001010000100101101101010101011010000001010001111010001101"
"0101010101010101010101010101010101010101010101010101010101010101010"
"0001010100101010100010110000101110111100001101110000000100111010001"
"0101010001000111110000111000011001010000010100011101100010001100010"
"0000100110000001101101111100111100011010010011001001100110010100001"
"0101101110100101011101011001100101111000010111111100011110001100010"
"0010001011011001000011001101000000100000110010111001101011100110001"
"0101110111011110010011010000110011100000100010100100111010010000010"
"0000010101010101101010100010111010101010000101101011111111000100001"
"1110010111100110011001000000100011110100001110101110110110011111111"
"0001110101110011000010101001011000101000100101001010111011101011001"
"1100001111100101010101101011110101001111111001100111000000100101111"
"0000001000110001000001110100000110111001000010011000010110100100101"
"0110000110101111011000101000001101101110100010101100001000010010011"
"0010100111001101101010011101000010001110001000100011111110000000000"
"0101111101000011011011000101000011011000001011101100011111110010010"
"1010111111101111000111110110101100110001011111100010101110100010100"
"0101010101010101010101010101010101010101010101010101010101010101010"
"0000100101011110100111010100111100110010111000001011100100110011000"
"0110101101111000010010001001000101001110001101010101010100000001011"
"1010110001110101001110001110011100111100110001011011111111110001100"
"0110101111111101010010011101000101000101101000110110001111001101111"
"0000011000010101100011101010011100010001101000000001000101010100100"
"0101101110111001110100011011010011111101001011010101111100101100111"
"1000001110011011001011001110111100010101000101001010011110000111000"
"0110011010101001010110110110111111101010101100110111000001000110111"
"0011111101101010100111010011010110000000101101011000011100010000101"
"0111101001000000011101011011111111111111111000111110010011100000111"
"0001011101010110100000110011000000000001000001000011111001011110001"
"1101010101010101111001110001011111111101100101100111100010100111111"
"1010011000000001100101111001010000000101100101011010100010101001100"
"0111011000110110010000001111010111110101001101111111101110100111010"
"1001000010001111100111111011010100010101010010101010100101110111100"
"0101010101010101010101010101010101010101010101010101010101010101010"
"0001011111111110101010010001010100010101100110001001010001011111100"
"1110101100000101010001001111010111110101000101111101111010011101110"
"0010101000010111101100110101010000000101100000010000100010111001101"
"0111000011001011011011001011011111111101001011010101000110110001011"
"1010000111010100100000010001000000000001001001111010110100100101100"
"0100000101111000110111110001111111111111111000011110111001000110110"
"1010110101011111101011100000001110001000010000010000001001111101001"
"1111010101100010011001101001111011011100010110011110110011010001011"
"1000000000100101100000110010110110111011101110100011110110010000100"
"0101100111100000111111100001010011000101110010100111110010010110011"
"0010111101110110001011101010110110101011011110001011111010100111001"
"0101001000111010010000101110001101110111101000110100010001101101010"
"0010110010010110000100010110111010100110100111100001110000011001100"
"1100000111010011011110001010110101110011101001101110111110001000011"
"0011011000010000101111110110111100010111110011111001111001101100100"
"0101010101010101010101010101010101010101010101010101010101010101010"
"0011101101101001001111001101110010010111111111011011010111011100001"
"0101110101011001010011011011011111111001000011101100111001101001110"
"1010000001101110000101100110111000001110010000011011010010100010101"
"1100000111101011111011001010010111010111001001011101111010110000011"
"1000011011100101001110001101101010110100000101111001000110110110100"
"0110000101001111010101000010100011010111111101001101100100011000110"
"0010010111010010001011011101010010000010100001001000001110001011101"
"0111110100111110010111011001110011111010100110011101010110111010110"
"1001100111110010001011110100001010110001010010110001010110010010001"
"1110001101100001110010100110000011101110001110010101001101000110110"
"0010001001101100001010101110111110011001101100101000101000000001000"
"0110000001011110111100001001011111111100010000011111000101111010111"
"1010111110100001101100101010000010011111011101010011001101101010101"
"1111100010001010010010100001000001111110010010011111010111010010110"
"0010111101010010000110101110001110001100111101100010101101001110100"
"0101010101010101010101010101010101010101010101010101010101010101010"
"0001010011000010100000100100010000011010100101110000010001110001101"
},
/* 37*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 17, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 71, 71, 1, "13 layers example",
"00001101010011011010101011001110001000011100011011001100101000001110111"
"01110010110000100111001011100101010101000111011001110000100101100001100"
"00000111000100010100111110101011100011011010001110001000101100010000011"
"01010101010101010101010101010101010101010101010101010101010101010101010"
"00100110000001101010101001010110000000010000000110001111111110011110110"
"11111011011100101101100110010110000101000110110000010110111101000111101"
"00100100011011100000100110101111110010000001001111001100101100010000001"
"10010100011010101101010010110110011100010111111011110000001111101101111"
"00101011101010011110011111000110001010001111100000101000010111110100100"
"01110001010111010011110110011111111100101111111001011100111100011011100"
"01001001100010010110100101100111110001111001011100101000100110100000111"
"00111011011110001101101010110101100110110111010000111101110110010111000"
"11100111101101001110101011000000111010010000100010000101111000001100101"
"00011011100101000111101010000111010100110111111101111000101001110101011"
"01100100100100100000010011001111011001010011001101100110001110111100101"
"11110010010011101001011110000011001100100010111101110000111011011111101"
"01000111000110000110001010111001100001001011100111000101101100101100111"
"00110100101011100111001111001111001110000111000111110000100010110101110"
"00000111110111111100110101001001001001100011101110000110011010001000110"
"01010101010101010101010101010101010101010101010101010101010101010101010"
"10000101100111000100101000001101000010110101001101100100111010001010111"
"01011011111000001111011101111111001101100011110110010001111010100011011"
"01000010010111011000001001111011001000011000100001000011001010100100110"
"01110011011110011011100001110010100111001011111010010011001000001111000"
"00100101100110111110000000010010110011011001101011000011000001011000001"
"10010001110001111001100001100110111100000100011111010111101101010101001"
"11001010010000000000000101100010100001011010000110001100101101101010110"
"01011000101110000111010111001100011100000100010001110011111010001011110"
"10100111001100111100000011001101100000000011101101000000001100001000001"
"00010111100101001111111110011111111111111111000100111111100111110111001"
"11100110100001111000100100011100000000000101100000000110010000011010000"
"01110010100000111011111000111101111111110110011101010000001000110111111"
"01100111111000100000100000110101000000010110110110001001100110111100101"
"11111101010100110011110111001101011111010100010111110010110100111111101"
"00000010000011011000111110100101010001010101100010101100011010101010001"
"01010101010101010101010101010101010101010101010101010101010101010101010"
"11101010011010111110000101111101010001010111110001101111011111100110010"
"11111000010111000011001010001101011111010110000110010100001001010101111"
"10101101110110101100001101111101000000010101110001101010110011011100010"
"00010001010100100011111010111101111111110101100000111101001010100111111"
"01001001110011110010100010011100000000000101000101100011010001001100000"
"00110111000011011101110110100111111111111111001110110010011010111101000"
"01000010111100100100011110010000110011101000011100000011000111010000100"
"10010110110100111001110100010010111101010010110011011011010000110101011"
"01001100010010011110111001010010001011010000100001100000110010010010001"
"01110101100000011011110001100001000100110010011101111111100111111011100"
"00000111000110110110011000000010010000100001111100001111000000010000111"
"11110100111001010111101010111011001101100011101000010110111110110111000"
"10100110001000100010101000110110111010110111110101101100001111001110111"
"10111100101000101011001010100010010101101001111110111110100100101101010"
"01001010000101010100100111000100011010110101111111101000110001100100101"
"01010101010101010101010101010101010101010101010101010101010101010101010"
"01101001110000100110110110101111100011010010001011101011100101001100110"
"01111001011010100001010111001110100110001010001010010000010111000001101"
"10100011101001010010001011100001001001001001110101001111110000001110110"
"11110000101000001011000101001101000111000001111001010101000100101001001"
"01101110001101111000101110100110001000010000010111101011111110100010110"
"01011001110010010011000001110110010110110111111010011010100000101001000"
"11100100101011000000111111111010100011011010000101101000100100101010001"
"11111000111001101001011101010101011100000111110011111000011001010011011"
"00001100000111101100001000101010010010000111000001001000001000101010000"
"01011111111000111101111111111110001100100100111000111000101100011101100"
"10000000010111011110110011111110001010010101010000100100001101100010110"
"01011000010000001101110010111000011100011100100010110101001000101111101"
"11101111101001111010001100010101110010001100101011101010110100000010010"
"01111001000010110011011101001100111101001011011010110111110011101101011"
"01000111110011011110000000100111100000100100010000001100011100100110111"
"01010101010101010101010101010101010101010101010101010101010101010101010"
"10100010010010011010011000100001010010000100000111000010111000111010010"
"10110010001101011101001110011001111101100101011010011110111110101111111"
"10000010100001001000010000110101001001110000100011100001100110010100001"
},
/* 38*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 20, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 83, 83, 1, "16 layers example",
"00001011100001101001010010111011000000000010110111001100101011111010100110010011011"
"00001100111101010101111001100010000000000101110110000101011100011010011001001000011"
"00000001101101111000000010100101011010101011110011000000000101010100111000110101100"
"00000001011011010000100001100100010011100110110001111100010100101011001101001110010"
"00000000001100010001111100100000001101101000111011001101101011111111010100111100001"
"01011111010001000100000101001101101011110110010101101000111100110110111111001000110"
"00111110001001101111110110110000101111111001111010001110000001101000001110111111110"
"00110010111000100000000111010110011100011101100000000010111101100111010111101110110"
"11011011101100101010111100101000011100101011000101011101101011111110000000101110111"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"00110001000101001110111100101110011110101000010110101001001001101111000100000111101"
"10011101011000000101011001011010000000001111011101011010011001001010111011010000001"
"00111100001111010001011100011111101011001001001100001100100010101101010010101000000"
"01111001010000111000000001010111001100010100001010111111111001110111000001100000110"
"01101011100101100000011100100111101100011011100101100100001000111101110100110000111"
"00101100111100001101101011101001000111110101011000100001010001101100010111011000000"
"11011101000101000011001000001000000011110010000011101010101000101010111000000000001"
"00011101111101011010111111101010010100111101101011001101010100101011101111110101111"
"01101110000001111101010010100001010110000011111101010110100000110110000000011001001"
"11000001110010000001100111100100111001000101101111011101011111010001001001001101110"
"01100110000000010011100010000111110100100000101000110000100011101001111110101001010"
"00001111010111011000000101110100010000011101010100001111110111011110110001111000100"
"00111010101011000001000110111000100100101011101100101010001101000001101000101111001"
"10110111010010111011110101111110100100010110000000001100010111001110011111100001111"
"01101101100100001111000100000111001100001001110101101100101100101100010010011110111"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"01110001101010111110111100010111000111100011010010001011000000000111010100010010101"
"01000101011101011111111011100111110001100101000010110011011011110110001001011011110"
"00000001001010111010100110100011111101101011111001001010000111001110011000000110011"
"10101001010110101101101011010111010010110101110011010101111010110101011111011011110"
"11000011001101110110001100010011111001010000011111101000001000110100001000100110111"
"01000101110110100100100001101101111011010100100100000111011111000010111011101101011"
"10111011000000000101001110100101010001000010111011001100001001100101001010001000101"
"00000111111101000001110111101111001000011111111010001011111011111111000101100111011"
"11001101100110010001111000110100011101111000000010010100100101101001111100101100011"
"01011110110011100111011111100111101111111111111110011110111011110101001111101111100"
"01110011000000010011101100101010100100000000000101110011101011111000000100010111010"
"11111101011100100010001101101010110101111111110110000001010110000101110011101011110"
"00100001001100000101010010110011111101000000010111101000000111011010000100101111001"
"11011100010110000010010001001111011101011111010101001101110011011001101011001001101"
"11101001101001001111010000100000100101010001010100111101101100010110101110001110111"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"10001010101001111000110000011010010101010001010110000001000001101000100110100101001"
"00100110111111000010100111101100000101011111010111100000010101110010110111111011000"
"01101101000101001111110100101001001101000000010111110101100110001011010100000010001"
"00000011010001111111111101010110001101111111110110101111111101001001101101010111001"
"01010110001110111110111000110011111100000000000100101100000000000100011100010110001"
"10110011111001010101010001111010100111111111111111001001110011010111000001010000010"
"01000010100111101000001100010111110001101001110000010101001010111000110010010010011"
"01100111111110101001111011111101010100010110010010001110011011111111111001100111011"
"00100011001101000111011100101001001001100001100101011011100011110011111000010111110"
"11011011110110101000101011010011110000011111010000101110010101111000100001110110010"
"10010010101100000111011110000000100001001000100001101101000110111110100010110111110"
"10101001111111001000010001101100110000110101100010110111110110100110010111011100001"
"01000001000111010001111110111111111000100010010010111100100101101101000000010100101"
"01111110011010101101000101101100000001011110000001011111111110000111010101110100111"
"01110010101100000101000110010101100011111000100011111111100101100111111010110110011"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"10000100000010001111001100010111111110010000110011111111001101000010101000111001001"
"11000000111010001001010011010101001001000110000111000001011011110011010011101010100"
"01101001001101001110011000011110010000101011110100101100001100101101000110000111111"
"01010001111101101001110011000111110101111111100111000001010011111010001001011010001"
"11010010101100011011111000000111001110101011101000101001001001011111010000000101001"
"11010001010011100100101101111000110010110101010011001101111111010011011101001101101"
"00001011001000000110010010110001101100111011001100011000000100111101010010011111101"
"01011011010110000101011001010111010100111101011100010001111001100101001011011000111"
"10000111100010000100110010011101010001010010111100101001001001110000101010001011110"
"01110010110000111011111011001101000001100101000111001001011010010101110111111000110"
"11101100100011010010011000010101000001110010000000000011001010001101001100011110111"
"01111011010111101010000111100110011001110100001110010011010010000100011101001001010"
"01110010000100001001111000111000010100000011100110110110001110010010110110110000010"
"10000011111001001010110011111011010110100110010110000101111100110100101101100011011"
"11010111100101001010100000100100111101101010000011111011000001000101000000001000010"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"00101011001111111000100010100110010110011001101010011100101000100000110110010100001"
"01100010110000110001111001101000010101111111001011110110111001000011110001111000010"
"00111101101110011011001110101000110011001011010100101110000011011011011000100010101"
"00000011010101100010010101100000100010100101011010110000110101010001011011110100110"
"11101001100011110111001010010010110100111011111000001010100100110010111110011111011"
"00001111110100011001011111110000110111011100110000110010010111111111110001110101100"
"10000100101110100001110110110100010111011001010001001011101111100110111100010011011"
"01101011110001110011001111101100101011010101110111110101111101011001011101100001111"
"00001001000010000110101000101110000100011010001100110010100011011111011100001101110"
},
/* 39*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 23, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 95, 95, 1, "19 layers example",
"00010001011000001001011100000100010100011110001000101101010001101011000110101100111011100100000"
"00111000100000010000111101010111001010100110100100101001100010111101100100110001001101001001000"
"00110000001000100010001011100100111100110000000000111101000101101101011010001100100111011100010"
"01000100100101111001001010000001100000000101010101110011011001011010010100011101001001000011000"
"00101111101010001000101101000010011110001100011000111111010100000111001010110110110101101101010"
"00111111010111010011111101110101100100110110001101101100101100011011100100010011000100111001010"
"11101010001110000010010101101110001111100000010001011101000000101110000000001000000111001110101"
"00100011110001011110011110101101000010100100010100010111110100011100011111101101110111110101110"
"10001011010111101011011111001110110001111011000010000001111000100101111010011100011110110110001"
"00100000101111111110100011110111110110001110001111101101011100110000101000110111100010000110110"
"01100110110110101010111001100110101000001100000011111100010010001101101100010010011110100101000"
"01100010011010110110011110011011111101001000101100001110011111010011101000100101100101110111101"
"00001111111110100100100001100000001101100100101011010000001100100000000011111100010100100110100"
"11000101101001011011100110011111001101001001000111000101010100010011001000001101110000111010110"
"00011000111010001000000000101110111001011011100011110001101100100001111100011010000010000011100"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"01011010011001000111000110001100110100010000101010100100111100100011100110000100111101001011101"
"11011011000111011011010011011011110010100111000110010010000110111011000000000111011001101110010"
"01110000011101101111111010011110011001010001101001010010110101100101100101010100100000111100100"
"00110001000001011011111101101101010100011111111111010110110011110001001111101101111011000101101"
"00011010010000100011001110111010111000100000001000100110001111100110111100100010000011101001110"
"10010110011011110010010101010101011111100000011101001000010011110101110101101011000100010010011"
"01100000110110000010000011110110110011111000000000010000000111000010111001111010001101010101101"
"01001010010110011010010011101111100101101101010111100111101110110011000000101101001000001110110"
"01001010011011100101000110110100011101010010010000100001110110000011001110011000000101011010010"
"00011001000011111010010100011111000000000001010100000001001101111011010011011001010101101110100"
"10010011100101100001101111011100011100001011110000010011101010000110110001010110101000010001000"
"11000010110010111010100000001001101001110000001101011110001101110101101011110001100010010011111"
"01011010000011000011000100111100010110110001111001101111101110000000011010101100011111010110101"
"10000001011000011001101011100011101100111011000100110001000101011111100111101101010111110111000"
"00110000010000101100001100000110111011001001001010111111011110100110110110101010101100110110000"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"11010111001000000101101001011100001001101101010000001000110100001011000101100000101100111111000"
"01110111000111010011011111011101001011111110101100000110001000111001000101111001000101101001001"
"01100110101010000001010011010010001011111111000000111010001011100110000010000110010111100111111"
"11100010100101110110001011000111101110100001011101101100101001110100100110010101101001111011000"
"00101000011100101100011011000110111010111110011001101111010110100101101111111110110110000011110"
"11110000110000011010000000001001111111011011110111111001011100110001101010100111110110101000011"
"11010101111011100101010000110010100001011011000010101111001000100010111111011000001101000011001"
"10110001111101010011111000010011100001100010101101110010100001110011001111011001101101111100100"
"00111001100101001100010001001110000011011110010000000011101110101000100100101010010101010010010"
"01110001111100111000100111110011001111101111111111111111100010110010111111101111000101011001010"
"00011011010000101000111001110100010110010100000000000101011110001000101001001110000010011011001"
"01111010111000010100101010011011111100010101111111110111110010011110001000111011010001111010011"
"10101110000010100000101011001010100110100101000000010111001111001001100011100010101000000000000"
"01001101110011110110001110110111101010101101011111010101111000011000110000110001010100011101100"
"01011111110001000010110011100110111101010101010001010101111000000100010010100010011000000100111"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"00000010101000100011000011010010000101100101010001010110110010000101100100111010011001101110010"
"11100010100011011000010011011011001100101101011111010111110101011011111110011011101100000100000"
"10010101010100000101011101011010000110010101000000010111001100000110100010000100000111100011001"
"10001110100011011100001111001011101100011101111111110111110101010001001001011101000110101000001"
"01011111101100101110111100010110110001010100000000000101011010000101101001011110010101100100111"
"01111000000011010010111111110011101110000111111111111111001011111111100110100111110101100000111"
"01011111000011101101011100001110111011010010001000001001100110000001001010011000010011011100100"
"10111010000000011110100110101101100111110001111100110000100010111111111111110111101011011011010"
"11000110000000101110011100000100001101000011101011011010000011101100011101011100110000100110111"
"01010111011001010011010011001001110000010100000110001001000001110011011001111111111011000010110"
"01000000100101100001100110101000101110111001101001010001010001100110100000000100111111111101101"
"11110111110000011001100011100111001001010010010101001011100011110001011010110111011011110000101"
"11110010001001000001110100000000011010110001100000111001111010000001111011010100010000111001010"
"00000111111001110100101001000001100000110111111110010111010000010110110000111101101100000111001"
"01100101110110101111001110110000011101011000011000011011000000000101011000010100001010010011010"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"10100001000100001111001010110010010001111001001000101000111001101111110100011110111110100111111"
"01100110111001111110100110111111010011110000100101011011101011011100111001101101011010001111001"
"11010000111000000010001001010010001110101011100000100100100111000011010000000000110111101100000"
"01001110110011011000000011100111011001000010110100101001011110011011111111111101001111010111111"
"01110100111010101011111111100110110010000110110001111010111001101011100111110010010101100111101"
"10000101000110111010010110101111100100111001100101100110100110110001000011011111100001000101111"
"11001100110001001101100000101000010001100001000011000111000110100101100110010000011101011011110"
"00110110010010010101101011100011010011010010101111110101001111111001100100010111100010101101110"
"01010010011100000100001000011010100001110001011010011111011010001110010100001010000001111111010"
"00110110101001010111001111000101111100100111011100011010100011110101011000100011011110100110001"
"00111100001001100101101001010010111001001000101010100101000110100010111010001000001011111110000"
"11010011100001111110011111100011010101111001110111011101111010110001000100001011100010101101100"
"00011011101100101011100110010010000000111110100010010111110110001100101100001000110101101101011"
"10100010010001010101110110000001010001111000110110010111110111010101011000111111111100100001000"
"00010010001111000011001100110100001100110010111011100101100110000011011101010000011011010000001"
"01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"
"01100000010110001101101110100010101101000000110011011110001101001010000011100000001111110101101"
"01110001010111010111111110111101110001101011111101001010101001010101101100100101111101100101000"
"00000001010101101110101101000110000011111100111011101010000111100100000011101000001001100011100"
"11101010010110010110001010100101101000011001111110001001000101111000100011001011110111010110000"
"00011001011111001111011100100000100111000111111001100011001111100010001010000110111011011100110"
"01000110101001111011010101001011011111011101001100110001001000010101111011010111001110010101100"
"11100001111001100100011000110000011111101110101000111000111000101100001011000010001011000010000"
"01101000001000111101110010101101011110011101110110011110101101111001111110111011101001111011101"
"00111100110101100100101111000010111011101111101000001000000001101110000011110100010100001001101"
"00110111011110010010110101011101010011110000101101111100010011010111110011101011001100100100000"
"10010000100010101001110111000100110101101011010011000110011000101000010010110100000111100010001"
"01000011010111010110000110110101011011011010000101010010011100110100100100010111000100000100111"
"01100100000110001010101110110010101010010010111011110001000101101101110000110010111000000101000"
"10011001111011010101011010011101111110101111010101011110010010111111000001000011100100110011001"
"00110101001011100000100011100010100110010100111000001111111101000000001100011000110110100110000"
},
/* 40*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 24, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 101, 101, 1, "20 layers example",
"00100011001001111011101000010101101000001111011011100001010111001110100001111011101010011110100110110"
"01001011101010010001000100010011010011001011100001000010011001000001100110100110000010001111010101011"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"00011101001110011000001000011100000111111011100011011000101010111101001110101000000011011011110001001"
"00110111010001010011110011111010101101000010101011110101001010101111101001000101011101001111011000100"
"11001010100111011100111011110011110001010100111110011110111100001101011011001110000100101011011011000"
"00110100001010001111000000000101101111111001110100111110000110010010010011011000101011001011100110100"
"10000110100100110101111010110111000100110001100001000001101110111001001101010010000110101111110110010"
"00100011010001010111111111100010101100000001111010101000101111110110100011011111101000001100110001100"
"01000110010011000000111011000010100100000001010111000111111010110000011001001010000010011100101001010"
"01100011010010000010010101111011011000011100110111101001001010000011011110101011011111001000011000111"
"00010000111110010000001101100011010101111110110100010100011110101100110111101111110011100000011110000"
"11111100100111001110001101010111011100101010100001110010101011101010110110011111001000001100111101101"
"00011100100001110000011111100100100101101001010101001001001100100001111100000110000110110110101101010"
"01111001011110101111000110100111001110000011100110101000111111111111011000101001011101011101000100110"
"11001000000111000101110111100111010101011010100001011110100001011000011010001101100010001000011010010"
"01111110010110100111101101011001011011100010110101110011001110000110011101111001001010111000101010110"
"00001101111011011101010000010110010111000000100100001110010101110101100001101111000000011000101010010"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"00010100101100011101111110100010100110101101011111001110100111100101101100010100000110111101000110011"
"10110000011000101111000110011001101010010011001110110110000110001111100101001101111101011111010101111"
"01001111101010011001101000100000000101110000000110001111011111000101110100111011010000011001111011011"
"01101110111000111010111010011000011000011110011001101101110011000111001110100010111010011011110110100"
"01011100100011000101110000001001100110100100010011011111101100001100100110110100010100110011000111010"
"00101001110100011010101001100110101100010001010100110001011110101011000011010101011110110111001010101"
"10000100100001011101111110100011110100110100111100001110010110111000101000000111000100100011000000011"
"11111001010111111111001000010000001011011011011110100011000010000010100101010110001100101011001110110"
"01010000101110101000001100110010100001100111000101000110000101000100100011001011100010100011100101001"
"10100110000100100111010011011000001011101110000010111001000010111110010010011011111010100100011111110"
"00001000100001011101111101110001100110001010000101010100111000001000010100110100000000011110000010011"
"11101110010011000111010101010001101010001011100111111110011111101010011001111101001100111010000000100"
"01011010000001001001100110100000000111001100111010011100101101101000101001011100000010000000111010011"
"01101000010101111110001110011010011101110111000101110001001110000111110100100001101100101011011110110"
"11011011100011101100001111101101110000010111010011010100111011101101110111101000010110011001011111011"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"00010100100001011000001100010010110110000100101100001111100010110000110100110010000010111111001011000"
"11110001000011101011010001000011111001101110011000110000011111000010101000110011101101000111000011111"
"11010101000010010100101111111101110111000110111100001110010000011001100010001001000000000000001001000"
"10101110111111110111011111110010001001111100110101111001000001000110110110000001101010100001110001110"
"00000101111110111101100010010011010011101110100111001001111001110000001011010100110111011001111110010"
"01111110110110001110110011000111001010001001001110100011000101111111011000100000001111011011111000110"
"00010001011011011101010001010000000010000010001101000010001001001100000100010100010000011101101110001"
"01101011110011010110100000111101011111101010001010111001001101000010011110000111101101001111010001101"
"10011000000010000100111110000001000001110111110011000000010001001101010001100000000100010010011110000"
"01101110010110111010010011001100101000010001111111111111111011101111101000110110111001100010000100101"
"01011100000011010101110001100001010110000010100000000000101101000001010001110011000001000000000011000"
"00110100110000010110100101001001001001001010101111111110110101110011001010101110001011000011000111101"
"11001001011101001000101011110001110110101001101000000010110101010000111100010010100100000010110001000"
"10101001011101010110001001010101011011100100101011111010101011001111111111001100001111111010101101100"
"10001010101011010100101010000000010110110001101010001010100001100101111001111110000100111111101110011"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"01010000110011111100010011010101100111110100101010001010111011111001010100110011110101111100110000010"
"01101001100001110110010011011000001110000001101011111010111110000010101101101100111001010100111100110"
"01000100000111101101110000110111010110110011101000000010110001101000011100101001100011100010111011011"
"10110110011101100011101001001100011101010110101111111110101100001111001100111100101110101011110000101"
"11011100001010001000101011011111010001100010100000000000111011011001001011000101110000100110000100010"
"01110010000010110011000110010100111010110010111111111111110011011110101011010101011100010100010010101"
"01011011011010101100000110110100100011110000001110011111000001110100100000101011100010010110100001001"
"11101010010110110111100011100011011111011100100000101010111111111011110101010000111001000001010010100"
"11000100001000101001111011011010100010011101100100000011101001000101010111011101110010011000000100010"
"00110001011110100010111100011100001110010000111010111001000110001111111111111100101010000110101101100"
"01000110001010000000011110100110100101110011101110010111010111101100011110111001110011111110000000010"
"10101110010110000011011010000111011101100111100001110011000001100110010010010000011011100100111011110"
"01011110111010000100011001011101010000001110000111001101011011101100010010001111010011100100000110000"
"11111001000101000110111110011110011100001001110011110001010110001010011011011011111110100000111000111"
"01010011111000000000100111011011110000010010011110010100010110000100000011001110000101000101110111010"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"01001011101111101001100011110110010011101001011100010001110101110100010100001000110000011100000101000"
"10110101000100110110111001001111001010011010100110110101101010010011110000000010101111010010010111101"
"11000111111001100001101000111101100010110111011101001010010110000101101100010010110110110000011001001"
"00110010100001100111101010101011111010100011010001110111110100111110100110110110001110001100110010101"
"01000111000110100100110000010100100101100010000010001101111001001101110110010001100110100101100001001"
"00111100001010011110101000011010001101101111010011110100111000011110110000001000001010011100101110111"
"00001111000100101100001100011101110110100100011000011010110100010001011011010001010110101000010110011"
"11101100000011011011001101011111011010111111011110101111000001001110101011011011111010111000100101111"
"00000111100100010000001101111011000001011100001010010000100010001001001010011111110000011111110010001"
"10101111110100110110100000001011111100001110100000111001111001111110010011110111101000000011101001100"
"00001010011111100101110101111110010110100000001101010100100011100100110001111010000001110111101010010"
"01111101100100110011101100000001111110011011011101111100101010111011100110010110001000101011010100100"
"01001110000000010001111010010001010111100010010001011100001011101000011100111110100010010110110000001"
"00110010100110010010001010011101011101011010100111111101111110110010001001001011001011001111010111110"
"11011010111010110100111111010111110111010110011100010000001011100101101010000011000100001000010110001"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"00001100011111001101010111100111110000011110111001001110000111010001110001001011100010011001000110010"
"01100011000010010110111111010010011011111111101101110111101011111010010111011011111100001110011110110"
"11000010100100011100101011010100010010101010111111001110100000011001011111100000010000110001011100010"
"01110101001111111111111010010101101101001000011001110100011101000111110101000010001101001011001000111"
"00010110110010010100100101101100000111000001110010011110000010110100001001001011110111011100110000001"
"00101010011111110010000110110100011100010001100011110110011101011111111010011111011000011111000010111"
"10000001101101100101100100001111010110010101010000001100000111001101001010011000000101111011101000011"
"01101001010101100111110010011111111100100011011111110001101010010011011000101000001000010000001101101"
"01001011110111111000111111011110100110100110010101000011100110000001010001000011000110100000110101010"
"01111101001011011011011000011001001101001111001011110011111100000111111110000101111111110010000010111"
"00000111000000001100011100010111100010010111110001010011100100001100010000111110100011010111101111010"
"10110011001101010010010001000110101001101001001011111111010011111010001110000110111000010110110110111"
"11001001000100110100001111011111000011111110101110000111010010001101010001001000000111010001000100000"
"01101000100001110110110000111100111111100101111000100000001011111110100011101000001000110000010110101"
"10001101110011001100111000100011000010110011101110000100101001011101001000100001010110011000100101001"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"01011101100101011001001110111110100111101011010110010100101110001100000100001110000011101010010100001"
"01100101110000100011110001100110011010011000001110100010010101000111010001001111111100001101100010111"
},
/* 41*/ { BARCODE_AZTEC, UNICODE_MODE, -1, -1, -1, 30, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, 0, 125, 125, 1, "26 layers example",
"00100110111101111000100011101010001011000100011001100001000110110101101111011010100110010101111010000000001001111011011101111"
"01000110110001010011111011000100001101000010100100110101101011001111101101110000100110101000000100001011010101000110110110011"
"00100000111011111011100111001111100011001111101001011011011111100001111010110111111101111111011010001000100011110110101111001"
"00011110101010010110000101011101100001000010010111101000110100011101011001011100101011110111110011011000000100010001101101011"
"11011010100001100110010110101010000010110100001100111000010100111111110111000111110110111111001111001100011111100001110011010"
"00010001000100001001011010000001000100011101100111100111010010000000010001000100010010101001100001110101101111000001110000111"
"10110111011001100011110110101111010100100110011101000111000101101111000110110110101111100101101000110100111100110010010100001"
"00111010010101001001011000110001011000001010100010000010010000000110100010011000000010110011000011111100001100000101000110100"
"01110010011100100011110000000011110000110101011010100101001011100110010001101111111001101110111010000101001011101110101011011"
"01110001110000001100010111110100010000010010000011000011011101011101100110101000111011110010010110111110110111001111101110000"
"00111011011000110100000011010011001110011110001010001101000111110000001101100111111100011001011011100001101101111000100011011"
"11010100111011010011101100010100001101010000110111011100111000011110111011000000011010111100110001010000010010011001101011111"
"00010000011111110101000001001110011011000101011001000001100000110011000110101111011000101111011100000001001110111100001101101"
"01100000101001010010110110110100100000100011000011110001111010000001000010001101110000110110110110001011110011000100101100010"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"11110011000110010001101011000000101001100111110011111100100101011001100101001100101001010100010111100100110111011000011101010"
"01011111101011100111010001000111000011111010011101111000111111110001101101101111011001101000101000001011110010111100011110100"
"00111001110000001010010001101001000110100010010000010010101000000010111001101000100001001100100011101010000010010100000001000"
"00111100110111111100001001101111111100100111001000110101101001100100000110111111110110101111001101110111000000101001110000011"
"10010110000011010111010111100100001100011010000100001001011001010110000000100101101000010100110011000110100010000001100010111"
"01001000101011110111011100110011000011000001111100101000000111111101001111111110111010100111011101010011101101101010011011101"
"01101010010001011101100000110000111000100000010110110111011101001110000001111000011100011010000011011100110101011001010011011"
"01101000111011111100011001100111110101010101101000100010001010101010010000010010000101110100111000100101101110110100111010010"
"00001111010010011011100011101101010101010001010100101000110101001100010110011000001101010011000001110100000100011100110010101"
"10101010111111111001000010000011010011101111101010011100110111100100111000001011000010111101001101001010111000101001110110111"
"11000000010001011111010011111101000011001000100110100010100010001100010101100001100001100101010000100001001000000100000000010"
"01101100111010100111001000101110110110111010101101101110110010101011001101011110111001101111001000001001010010100011000010000"
"10000111001001000011110110001101011000000101110010011101000101010111101110100001010111011110010011100110101110000100101001011"
"00010100011000111100011011011011011000101100001110110010111111111000001111000011011100001101101011110001100101110111001100110"
"11110010001100000101110101010101001010011000010000110101000111001101100101110001100000000100010010010111000110000101011101010"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"01111111111011011011000100001101001110101000000011110110011010000010011100001100000100000010110010100110000011000101010010100"
"01100101110011101011011101101110111110101011001111110110100010110011110001011010110011110111111001000110110110101001011001110"
"11011011000001011111011110011100100101001110100000100110100100010100010110110000000010110010110000011111011011011110100001100"
"00010000000001111101100111000110001101100110111101101100100000101011101101110110111100010000001100000000001001101110101010100"
"11000111101011011011000000111100010010111101000111110000111110001001101100010100001100011010100010100110110100000000011101010"
"11111011101111100010100010101010001111110101001001110011111101101001011000101111010110110111111001100001010000101100011110011"
"10000110000111000011010111101100010010000111110011000001110100000011110000100101100111001011110000011101001101011100110011111"
"00010001100111101011000001100110011110110100011101001010011101110100010111000110010010001000011101111000010011100101100011101"
"01010010011100010110000011011101100101010100000111111001111011000001111010101001101101100111010011010100101010001000110001111"
"00101110000010110000000010101010011001110100011100001101001111111010010000011111101011011111101011010100111010111101111001000"
"01100101000110001011101111010001111100001001010101001101001011011111001010001100110010101101010000110011100110000011110001100"
"10110010000011111001000101001111001101111110111101101010111111110010001101101010110011001001111111010011000010101110010101110"
"01110001110111000111101110000001011001000101010100011011111101000110111000110000111110010100000100000000100010010001000111100"
"01000101110110100011001010000010011111010101011100010110110110101010011001111110110010111110001011111101000010111101110011111"
"00000011111101011111111010110000010011110101110001111010010101001001010111111101011101101001110011111011001000001000010011011"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"11111111110110000001100010101001100010101000000011101101101011010100101100101001010100001110100110101110110001000111111101001"
"10100101101011101100001001010111111000011001011010100110110110110111100011011111111000000101111011111001011000100000110110000"
"10000011001010011010001100111001111110100011010010101011010010010010000010101101011100100001110101101001000111010000100110000"
"01010000000001110100001111110011111111010110011101100011100001101110101101100010000010110001101101010000100001100001001010000"
"01001101000000001001110011010101011010110101100011101010100110001001111000011001111001011110000010001100001110011101010111101"
"01001010010011111010100000101011110001101111011101101110011001100011000001011111000100010001011011100011001100111101010001101"
"10111001010101001101001000100101000111001001110101000101111110000110100000110000000000100101000010111101000110000000100101011"
"11110010100100111011000101101010011010011000001011010000110110101000111100111010110011100010011010110000100111111010000010101"
"01111010010001001001011001000100110111010110100100101001111001000000010010110100100011100100010110001010011000011100110010111"
"01111100100011101110100110011010110000110010111111001011111111111111111001101011011001011110001111010101010110110101000101010"
"11100010111011011110101100101101101011100111010111110110100000000000101101110100000001011101010100111101101111001001011000111"
"11001010001011100000100010001111001000001010111111001011101111111110110001100110110101000110101110010100001111111000111100000"
"00111110010011011000000001110101000100100111110000110110101000000010100011000100010010000001000111011001101000000010001000101"
"01011000101101111000100110000011011110101111101110110101101011111010110010011010100111001010101011011110101001111101111000001"
"10001111000011000110100111100001001001010000100100000000101010001010101101100101000001011101010001000110101000010111111011101"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"01000100110000011011101100101101000111011001110101101001101010001010110110001001000111101110000111100001100001010110000100000"
"11011000111110101001001010000010001110010101101000010100101011111010110000011010011001111100011101001110111000110010100110000"
"01101111011110000100101101111101101001010100110100101011101000000010110101010000011110000001010011111111111111010110000100011"
"01010110011010100011101010000011011010100110001000010101101111111110100000010010001000111101011001111010011110101100111010111"
"10100110000100011000110010110001110011000000000001110010100000000000111000001101111100010000110001000101011000001101000011001"
"11111101111111101101000111001110000100100010001111110000111111111111111101011010011010111100011101011101110001100111000110000"
"00000000001000011011100010001000101100011111010011101100010100010001001001000101111010111001010101100100000000000001001111111"
"01111010110010111000111010001110011011000111111001101100101101100011101000101110111101011010101101010010000010100110100000000"
"00000011001011010011011001010000101011111010000011000110001101000101111100011000001010001100000110010101110000010001010111010"
"00101110100111111001110011100111110101101110111010000000111101100001010111010011001010001011101001011111001111101100100010010"
"11100001001000001010011111100101001000101011010001100001010001000001101101111001100111000000110100001110000111000110101011110"
"00101101011011111011010101000110000010111100001111101000000010101110100110011010000000110111001100010001101001100000100110101"
"10100111110000011011111101110001001110011011100101111010100111000011101001000001111111001010010011011000000001011110100100000"
"00100010110010111111111101001011010011111011011000001010001010100000001100010010011001110101101000001011000010101100111011101"
"01101111001001011101010100100000110111110001100001100111100001000011100000110100101111001011000100111011100101010011110100100"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"01000001101111001110000010100000011110111100010111110101001010001100011110000001110100011011000101011111111001010100110011100"
"00011011011001110111010100101011010010101001011001110110100110110111101100000111010010100101001010111110011110110111011010001"
"11000001000111000100101011101000011010000101010010011101111000000011010101001100011110000000000010110010001110010000101011111"
"00001000110001110110010001111111101001000100001010100110111101111110010111010111101010100100011000100000010010101110001110110"
"01001010000111000110111000011001000111110111100011100100010001000010010100111100010101101001000101000101001110001011001001001"
"11011011010100111001010111111110000111011011001100111011110001100000010110100011101001111010111010100000000110111001011010010"
"01000001010101001001110100010101110001011111000010001111001101010000101100001101111001000100010010111110100000001100101010111"
"00000011101100101011110101100110101010101000101001111010100111101100111011010011110110011011001011011001101100100100110000010"
"00010000011010001101110110101100010110011111000011100101010001001010000011100101011100101110110010101011001101001100011000110"
"10111100011001110010011011100010111111110011111110110111101011110011011011110010110101011010001001100001001000111001001001000"
"01001101111010011000100000000000111101011001010010110000111100001100001010110000100000110110110010100111110010000010000101001"
"01010100110101100100111111111110111001010101011100101001101111111100111011000110110011010010001110101001011110101110101000011"
"01100011001101000000110011100001000110101100100010101100101001001001111000010001010011000010100110110110011110000111001101010"
"00001001110100111111000100010110000000000001111011000001100101100001000011011010111101101001011101001101100101100111011110111"
"10100101010100010110111001000101101010111101000100001001010100011010101000100101101000000001000100010010011110011000010100100"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"11010111111010011101000100111100011010110100100100001010001011000011010110001001111110101011110000000001111110010110000000001"
"01101110000001101001011001111011111000100011011100011001111001101100101110101010000100001110101110011001101111101011000010110"
"10010010101001000010001011101101110001100000110111010010110001001010101000001100000010000010010110110110101111001001010110011"
"00101101000011111001001111011010010111010001111000111101000010110110111111010110101101111100011100011101011001111110010001110"
"11111111110001010111011001011101011011011101000101010110001010000100001110011001010111110111010011000001110000001111101001010"
"01110101001011100100011000011110111010101110101010001111101001101101000001010111000011110100111010000111111111111010001110011"
"01100001100011001111100111111100010011111111100000110110110100010110011100001100111000000011100011110011110110011111100000100"
"11101010100111101000011000000011000111111110111100011011011110111000010100100011101000010100011011001100001100111101100111000"
"00010011100110011001000010011100110110101010010111001001100100011101001100101100011011111111010001011010000010011001101000101"
"11000000011001111010100001011110101111110000101100010001100100110100010000110011111101101111111111001111101100111101001111000"
"11011101100011011111110111110001010101011001110010110101000100000100001000111001011001110000100000101010111100000101010000101"
"10001110001111110000111000100110101000110101111110101111100111110100001001010011110101101000001000000111000101110011111110011"
"00000100000010001011111100001000110010111101010000010100011110011001101001000100001110111101100100011010100001011101100001110"
"01011110011110101011101101101111000010001101001101101011000100111101010010001110110110011011011010100010110000110100101010100"
"00110100001101011010001101011001110100001010010110000100001001010111001110111100010110111100110000001101001101011101000111101"
"10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
"01001111011101001001010110001100010111100100110001010110011001001000110110000001110001101001000100010001001010000001110000011"
"10101010010111100010001011101111011111101111111110010011000110100110001010000011001001011101001111100010001100111001010010001"
"01011001101000010010010010010000000000101011100111000111001100010110100111011101000010000000000001111011001010010110110110000"
"01100000110100111110010100010011111000000110011101011000110001110000011010111010001100111010111011100100011100111100000010011"
"00010011110111011110101100010001010011101111110100111101110001001010010110011000011000110001100100011011000100001100111101111"
"11010111110111100000011001111110011011011100001110010000011010111011010101101011100101010111111111010001001111111110110100110"
"10101101000111000001100010001001001110010100000010111011011111011010111001110100010011010001110101001011001011000000000100010"
"10101101010011111111101010100110011110100001111001111001000010101110001010010110111011101000111110010110100110110111111001011"
"01000100111101001111001101111001011000001100100101001000101100001011011001111001111001111101010110011100011011010100001011000"
"01110011100101110100000001101011011100111001011001000110011000111111101100101010001100010100111001100111101110100010110100011"
"01000010001110010101101011111000101110111100000000101010011010001000100011110001111111010110000000001011000100010010111011001"
"10111101100100101011011111010011010000111000111110010011100110101101010001011110000001100001101111111101101111110011101100101"
"11111010111101011001001001001000000000110100010101011110101011001010101011000101010010100111110010111001110100001111110111011"
"10011001010011111111011111100010010011110010001010100100000110100111000110011010110111001010011011101001111100110010110010011"
},
/* 42*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "0", -1, 0, 11, 11, 1, "ISO/IEC 24778:2008 Figure A.1 (1st)",
"11101010101" "11101010101"
"11111111111" "11111111111"
"01000000010" "01000000010"
@ -1266,7 +2056,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00101010100" "00101010100"
}, },
/* 31*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "25", -1, 0, 11, 11, 1, "ISO/IEC 24778:2008 Figure A.1 (2nd)", /* 43*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "25", -1, 0, 11, 11, 1, "ISO/IEC 24778:2008 Figure A.1 (2nd)",
"11101100101" "11101100101"
"11111111111" "11111111111"
"01000000011" "01000000011"
@ -1279,7 +2069,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00100100000" "00100100000"
}, },
/* 32*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "125", -1, 0, 11, 11, 1, "ISO/IEC 24778:2008 Figure A.1 (3rd)", /* 44*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "125", -1, 0, 11, 11, 1, "ISO/IEC 24778:2008 Figure A.1 (3rd)",
"11110101101" "11110101101"
"11111111111" "11111111111"
"11000000011" "11000000011"
@ -1292,7 +2082,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00111101000" "00111101000"
}, },
/* 33*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "255", -1, 0, 11, 11, 1, "ISO/IEC 24778:2008 Figure A.1 (4th)", /* 45*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "255", -1, 0, 11, 11, 1, "ISO/IEC 24778:2008 Figure A.1 (4th)",
"11010101001" "11010101001"
"11111111111" "11111111111"
"01000000011" "01000000011"
@ -1305,7 +2095,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00110011100" "00110011100"
}, },
/* 34*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "1", -1, 0, 11, 11, 1, "", /* 46*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "1", -1, 0, 11, 11, 1, "",
"11101010101" "11101010101"
"11111111111" "11111111111"
"11000000011" "11000000011"
@ -1318,7 +2108,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00100110100" "00100110100"
}, },
/* 35*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "15", -1, 0, 11, 11, 1, "", /* 47*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "15", -1, 0, 11, 11, 1, "",
"11101001001" "11101001001"
"11111111111" "11111111111"
"11000000011" "11000000011"
@ -1331,7 +2121,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00001111100" "00001111100"
}, },
/* 36*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "16", -1, 0, 11, 11, 1, "", /* 48*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "16", -1, 0, 11, 11, 1, "",
"11101110101" "11101110101"
"11111111111" "11111111111"
"11000000010" "11000000010"
@ -1344,7 +2134,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00111100100" "00111100100"
}, },
/* 37*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "63", -1, 0, 11, 11, 1, "", /* 49*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "63", -1, 0, 11, 11, 1, "",
"11100101001" "11100101001"
"11111111111" "11111111111"
"11000000011" "11000000011"
@ -1357,7 +2147,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00101010000" "00101010000"
}, },
/* 38*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "64", -1, 0, 11, 11, 1, "", /* 50*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "64", -1, 0, 11, 11, 1, "",
"11111010101" "11111010101"
"11111111111" "11111111111"
"01000000010" "01000000010"
@ -1370,7 +2160,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00111011100" "00111011100"
}, },
/* 39*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "65", -1, 0, 11, 11, 1, "", /* 51*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "65", -1, 0, 11, 11, 1, "",
"11111010101" "11111010101"
"11111111111" "11111111111"
"11000000011" "11000000011"
@ -1383,7 +2173,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00110111100" "00110111100"
}, },
/* 40*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "126", -1, 0, 11, 11, 1, "", /* 52*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "126", -1, 0, 11, 11, 1, "",
"11110101001" "11110101001"
"11111111111" "11111111111"
"01000000010" "01000000010"
@ -1396,7 +2186,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00110111000" "00110111000"
}, },
/* 41*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "127", -1, 0, 11, 11, 1, "", /* 53*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "127", -1, 0, 11, 11, 1, "",
"11110101001" "11110101001"
"11111111111" "11111111111"
"11000000011" "11000000011"
@ -1409,7 +2199,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00111011000" "00111011000"
}, },
/* 42*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "128", -1, 0, 11, 11, 1, "", /* 54*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "128", -1, 0, 11, 11, 1, "",
"11001010101" "11001010101"
"11111111111" "11111111111"
"11000000010" "11000000010"
@ -1422,7 +2212,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00100010000" "00100010000"
}, },
/* 43*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "191", -1, 0, 11, 11, 1, "", /* 55*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "191", -1, 0, 11, 11, 1, "",
"11000101001" "11000101001"
"11111111111" "11111111111"
"01000000011" "01000000011"
@ -1435,7 +2225,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00100010100" "00100010100"
}, },
/* 44*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "192", -1, 0, 11, 11, 1, "", /* 56*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "192", -1, 0, 11, 11, 1, "",
"11011010101" "11011010101"
"11111111111" "11111111111"
"11000000010" "11000000010"
@ -1448,7 +2238,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00110011000" "00110011000"
}, },
/* 45*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "225", -1, 0, 11, 11, 1, "", /* 57*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "225", -1, 0, 11, 11, 1, "",
"11010010101" "11010010101"
"11111111111" "11111111111"
"11000000011" "11000000011"
@ -1461,7 +2251,7 @@ static void test_encode(int index, int generate, int debug) {
"01111111111" "01111111111"
"00001100100" "00001100100"
}, },
/* 46*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "254", -1, 0, 11, 11, 1, "", /* 58*/ { BARCODE_AZRUNE, UNICODE_MODE, -1, -1, -1, -1, "254", -1, 0, 11, 11, 1, "",
"11010101001" "11010101001"
"11111111111" "11111111111"
"11000000010" "11000000010"

View File

@ -2346,7 +2346,7 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%ssepheight=0", strlen(bwipp_opts_buf) ? " " : ""); sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%ssepheight=0", strlen(bwipp_opts_buf) ? " " : "");
bwipp_opts = bwipp_opts_buf; bwipp_opts = bwipp_opts_buf;
} else if (symbology == BARCODE_AZTEC || symbology == BARCODE_HIBC_AZTEC) { } else if (symbology == BARCODE_AZTEC || symbology == BARCODE_HIBC_AZTEC) {
int compact = 0; int compact = 0, full = 0;
if (option_1 >= 1 && option_1 <= 4) { if (option_1 >= 1 && option_1 <= 4) {
int eclevel; int eclevel;
if (option_1 == 1) { if (option_1 == 1) {
@ -2368,6 +2368,7 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
layers = option_2; layers = option_2;
} else { } else {
layers = option_2 - 4; layers = option_2 - 4;
full = layers <= 4;
} }
sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%slayers=%d", strlen(bwipp_opts_buf) ? " " : "", layers); sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%slayers=%d", strlen(bwipp_opts_buf) ? " " : "", layers);
bwipp_opts = bwipp_opts_buf; bwipp_opts = bwipp_opts_buf;
@ -2379,8 +2380,8 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
if (symbology == BARCODE_HIBC_AZTEC) { if (symbology == BARCODE_HIBC_AZTEC) {
compact = 1; compact = 1;
} }
if (compact) { if (compact || full) {
sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%sformat=compact", strlen(bwipp_opts_buf) ? " " : ""); sprintf(bwipp_opts_buf + (int) strlen(bwipp_opts_buf), "%sformat=%s", strlen(bwipp_opts_buf) ? " " : "", compact ? "compact" : "full");
bwipp_opts = bwipp_opts_buf; bwipp_opts = bwipp_opts_buf;
} }
} else if (symbology == BARCODE_CODEONE) { } else if (symbology == BARCODE_CODEONE) {