mirror of
https://git.code.sf.net/p/zint/code
synced 2026-01-24 20:36:03 +00:00
AZTEC: fix ECC to be at least advertised percentages (ticket #347,
props Francois Grieu)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* aztec.h - Handles Aztec 2D Symbols */
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2008-2024 Robin Stuart <rstuart114@gmail.com>
|
||||
Copyright (C) 2008-2026 Robin Stuart <rstuart114@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@@ -117,37 +117,38 @@ static const short AztecCompactSizes[4] = {
|
||||
17, 40, 51, 64 /* 64 data blocks (Mode Message max) but 76 altogether */
|
||||
};
|
||||
|
||||
/* Tables `AztecDataSizes` and `AztecCompactDataSizes` generated by "backend/tools/gen_aztec_data_sizes.php" */
|
||||
static const short AztecDataSizes[4][32] = { {
|
||||
/* Data bits per symbol maximum with 10% error correction */
|
||||
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, 15000, 15948, 16920, 17940
|
||||
95, 241, 408, 609, 840, 1099, 1387, 1704, 2040, 2418, 2814, 3246, 3714, 4200, 4722, 5262,
|
||||
5838, 6450, 7080, 7746, 8430, 9150, 9900, 10677, 11476, 12319, 13183, 14068, 14997, 15948, 16920, 17935
|
||||
}, {
|
||||
/* Data bits per symbol maximum with 23% error correction */
|
||||
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, 12828, 13644, 14472, 15348
|
||||
79, 203, 345, 518, 715, 936, 1183, 1454, 1741, 2064, 2403, 2772, 3173, 3589, 4035, 4497,
|
||||
4990, 5514, 6053, 6622, 7208, 7824, 8464, 9130, 9813, 10534, 11273, 12031, 12826, 13639, 14470, 15339
|
||||
}, {
|
||||
/* Data bits per symbol maximum with 36% error correction */
|
||||
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, 11340, 12024, 12744
|
||||
62, 166, 283, 426, 590, 774, 979, 1204, 1442, 1710, 1992, 2299, 2632, 2978, 3349, 3733,
|
||||
4142, 4578, 5026, 5499, 5986, 6498, 7029, 7582, 8150, 8749, 9364, 9994, 10654, 11330, 12021, 12743
|
||||
}, {
|
||||
/* Data bits per symbol maximum with 50% error correction */
|
||||
48, 126, 216, 328, 456, 600, 760, 936, 1120, 1330, 1550, 1790, 2050, 2320, 2610, 2910,
|
||||
45, 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, 8844, 9384, 9948
|
||||
}
|
||||
};
|
||||
|
||||
static const short AztecCompactDataSizes[4][4] = { {
|
||||
/* Data bits per symbol maximum with 10% error correction */
|
||||
78, 198, 336, 512 /* Max 64 * 8 */
|
||||
73, 198, 343, 512 /* Max 64 * 8 */
|
||||
}, {
|
||||
/* Data bits per symbol maximum with 23% error correction */
|
||||
66, 168, 288, 440
|
||||
60, 166, 290, 444
|
||||
}, {
|
||||
/* Data bits per symbol maximum with 36% error correction */
|
||||
48, 138, 232, 360
|
||||
47, 135, 237, 365
|
||||
}, {
|
||||
/* Data bits per symbol maximum with 50% error correction */
|
||||
36, 102, 176, 280
|
||||
33, 102, 180, 280
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user