mirror of
https://git.code.sf.net/p/zint/code
synced 2025-12-20 03:17:12 +00:00
- AZTEC/CHANNEL/CODABLOCKF/CODE16K/CODE49/CODEONE/DATAMATRIX/
DOTCODE/GRIDMATRIX/HANXIN/MICROPDF417/MICROQR/PDF417/QRCODE/
RMQR/ULTRA: set `option_1/2/3` to values used in encodation
("Feedback options"), and add new access methods
`encodedOption1()` etc. to Qt Backend, and use in GUI to provide
better feedback on "Automatic" selections
- AZTEC: give more precise warnings in low ECC situations, and
indicate via `option_1` by setting to -1 (min 3 words), 0
(<5% + 3 words) (`ecc_ratio`)
- set_height: fix non-compliance false positives by using epsilon
in checks (prompted by CODABLOCKF non-compliant warning for
zint-generated compliant height - floating point `rows` mult !=
`zero_count` div; one test regression for CODE93);
better warning messages on non-compliant heights (min/max)
- manual/man page: fix DATAMATRIX Sizes tables "28 12x26" ->
"27 12x26"
- GUI: AZTEC/CODEONE: add Zint versions to comboboxes
- DOTCODE: improve error messages re size too small/large
- ULTRA: better ZINT_TEST codeword dump (ZINT_DEBUG_TEST)
- general: various tabs -> spaces; prettify main .rc files;
trailing spaces; small amount of code fiddling (CODE16K)
This commit is contained in:
@@ -1378,7 +1378,7 @@ static int hx_evaluate(const unsigned char *local, const int size) {
|
||||
/* Apply the four possible bitmasks for evaluation */
|
||||
/* TODO: Haven't been able to replicate (or even get close to) the penalty scores in ISO/IEC 20830:2021
|
||||
* Annex K examples */
|
||||
static void hx_apply_bitmask(unsigned char *grid, const int size, const int version, const int ecc_level,
|
||||
static int hx_apply_bitmask(unsigned char *grid, const int size, const int version, const int ecc_level,
|
||||
const int user_mask, const int debug_print) {
|
||||
int x, y;
|
||||
int i, j, r, k;
|
||||
@@ -1472,6 +1472,8 @@ static void hx_apply_bitmask(unsigned char *grid, const int size, const int vers
|
||||
}
|
||||
/* Set the Structural Info */
|
||||
hx_set_function_info(grid, size, version, ecc_level, best_pattern, debug_print);
|
||||
|
||||
return best_pattern;
|
||||
}
|
||||
|
||||
/* Han Xin Code - main */
|
||||
@@ -1481,7 +1483,7 @@ INTERNAL int hanxin(struct zint_symbol *symbol, struct zint_seg segs[], const in
|
||||
int ecc_level = symbol->option_1;
|
||||
int i, j, j_max, version;
|
||||
int full_multibyte;
|
||||
int user_mask;
|
||||
int user_mask, bitmask;
|
||||
int data_codewords = 0, size;
|
||||
int size_squared;
|
||||
int codewords;
|
||||
@@ -1673,7 +1675,12 @@ INTERNAL int hanxin(struct zint_symbol *symbol, struct zint_seg segs[], const in
|
||||
}
|
||||
}
|
||||
|
||||
hx_apply_bitmask(grid, size, version, ecc_level, user_mask, debug_print);
|
||||
bitmask = hx_apply_bitmask(grid, size, version, ecc_level, user_mask, debug_print);
|
||||
|
||||
/* Feedback options */
|
||||
symbol->option_1 = ecc_level;
|
||||
symbol->option_2 = version;
|
||||
symbol->option_3 = (symbol->option_3 & 0xFF) | ((bitmask + 1) << 8);
|
||||
|
||||
symbol->width = size;
|
||||
symbol->rows = size;
|
||||
|
||||
Reference in New Issue
Block a user