mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
- PDF417/MICROPDF417: use latch not ps shift for padding when
spanning Text segments to avoid affecting 1st char of 2nd segment - PDF417/MICROPDF417: add optimized encoding, FAST_MODE for previous scheme; formatting changes - common.c/h: add `cnt_digits()`, comments in include and make more consistent, minor code fiddling - DOTCODE: replace `dc_n_digits()` with new `cnt_digits()` - test_qr: fix `test_qr_perf()` - composite: minor code fiddling - library: debug dump HIBC-processed input - BWIPP: update to latest
This commit is contained in:
parent
fbfaabf004
commit
e515f63fab
@ -20,6 +20,9 @@ Changes
|
|||||||
and returning error if so rather than continuing to process
|
and returning error if so rather than continuing to process
|
||||||
- manual: MSE typo -> MSI; adjust SVG scaling for PDF manual; pandoc 2.19.2
|
- manual: MSE typo -> MSI; adjust SVG scaling for PDF manual; pandoc 2.19.2
|
||||||
- manual/man page/GUI: Code 16k -> Code 16K
|
- manual/man page/GUI: Code 16k -> Code 16K
|
||||||
|
- PDF417/MICROPDF417: add optimized encoding, FAST_MODE for previous; formatting
|
||||||
|
changes
|
||||||
|
- common.c/h: add `cnt_digits()`, comments in include, minor fiddling
|
||||||
|
|
||||||
Bugs
|
Bugs
|
||||||
----
|
----
|
||||||
@ -45,6 +48,8 @@ Bugs
|
|||||||
- MSVC project files: remove incorrect "CompileAsCpp" setting from libzint
|
- MSVC project files: remove incorrect "CompileAsCpp" setting from libzint
|
||||||
project files (ticket #272)
|
project files (ticket #272)
|
||||||
- bwipp_dump.ps: fix 2/4-track processing; update to latest BWIPP
|
- bwipp_dump.ps: fix 2/4-track processing; update to latest BWIPP
|
||||||
|
- PDF417/MICROPDF417: use latch not ps shift for padding when spanning
|
||||||
|
Text segments to avoid affecting 1st char of 2nd segment
|
||||||
|
|
||||||
|
|
||||||
Version 2.11.1 (2022-08-22)
|
Version 2.11.1 (2022-08-22)
|
||||||
|
@ -568,7 +568,9 @@ typedef const struct s_channel_precalc {
|
|||||||
long value; unsigned char B[8]; unsigned char S[8]; unsigned char bmax[7]; unsigned char smax[7];
|
long value; unsigned char B[8]; unsigned char S[8]; unsigned char bmax[7]; unsigned char smax[7];
|
||||||
} channel_precalc;
|
} channel_precalc;
|
||||||
|
|
||||||
/*#define CHANNEL_GENERATE_PRECALCS*/
|
#if 0
|
||||||
|
#define CHANNEL_GENERATE_PRECALCS
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CHANNEL_GENERATE_PRECALCS
|
#ifdef CHANNEL_GENERATE_PRECALCS
|
||||||
/* To generate precalc tables uncomment CHANNEL_GENERATE_PRECALCS define and run
|
/* To generate precalc tables uncomment CHANNEL_GENERATE_PRECALCS define and run
|
||||||
|
@ -51,9 +51,8 @@ INTERNAL int ctoi(const char source) {
|
|||||||
INTERNAL char itoc(const int source) {
|
INTERNAL char itoc(const int source) {
|
||||||
if ((source >= 0) && (source <= 9)) {
|
if ((source >= 0) && (source <= 9)) {
|
||||||
return ('0' + source);
|
return ('0' + source);
|
||||||
} else {
|
|
||||||
return ('A' + (source - 10));
|
|
||||||
}
|
}
|
||||||
|
return ('A' - 10 + source);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Converts decimal string of length <= 9 to integer value. Returns -1 if not numeric */
|
/* Converts decimal string of length <= 9 to integer value. Returns -1 if not numeric */
|
||||||
@ -72,7 +71,7 @@ INTERNAL int to_int(const unsigned char source[], const int length) {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Converts lower case characters to upper case in a string source[] */
|
/* Converts lower case characters to upper case in string `source` */
|
||||||
INTERNAL void to_upper(unsigned char source[], const int length) {
|
INTERNAL void to_upper(unsigned char source[], const int length) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -83,12 +82,12 @@ INTERNAL void to_upper(unsigned char source[], const int length) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the number of times a character occurs in a string */
|
/* Returns the number of times a character occurs in `source` */
|
||||||
INTERNAL int chr_cnt(const unsigned char string[], const int length, const unsigned char c) {
|
INTERNAL int chr_cnt(const unsigned char source[], const int length, const unsigned char c) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
if (string[i] == c) {
|
if (source[i] == c) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -168,7 +167,7 @@ INTERNAL int is_sane_lookup(const char test_string[], const int test_length, con
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the position of data in set_string */
|
/* Returns the position of `data` in `set_string` */
|
||||||
INTERNAL int posn(const char set_string[], const char data) {
|
INTERNAL int posn(const char set_string[], const char data) {
|
||||||
const char *s;
|
const char *s;
|
||||||
|
|
||||||
@ -180,7 +179,8 @@ INTERNAL int posn(const char set_string[], const char data) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert an integer value to a string representing its binary equivalent and place at a given position */
|
/* Converts `arg` to a string representing its binary equivalent of length `length` and places in `binary` at
|
||||||
|
`bin_posn`. Returns `bin_posn` + `length` */
|
||||||
INTERNAL int bin_append_posn(const int arg, const int length, char *binary, const int bin_posn) {
|
INTERNAL int bin_append_posn(const int arg, const int length, char *binary, const int bin_posn) {
|
||||||
int i;
|
int i;
|
||||||
int start;
|
int start;
|
||||||
@ -198,28 +198,28 @@ INTERNAL int bin_append_posn(const int arg, const int length, char *binary, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Z_COMMON_INLINE
|
#ifndef Z_COMMON_INLINE
|
||||||
/* Return true (1) if a module is dark/black, otherwise false (0) */
|
/* Returns true (1) if a module is dark/black, otherwise false (0) */
|
||||||
INTERNAL int module_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord) {
|
INTERNAL int module_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord) {
|
||||||
return (symbol->encoded_data[y_coord][x_coord >> 3] >> (x_coord & 0x07)) & 1;
|
return (symbol->encoded_data[y_coord][x_coord >> 3] >> (x_coord & 0x07)) & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set a module to dark/black */
|
/* Sets a module to dark/black */
|
||||||
INTERNAL void set_module(struct zint_symbol *symbol, const int y_coord, const int x_coord) {
|
INTERNAL void set_module(struct zint_symbol *symbol, const int y_coord, const int x_coord) {
|
||||||
symbol->encoded_data[y_coord][x_coord >> 3] |= 1 << (x_coord & 0x07);
|
symbol->encoded_data[y_coord][x_coord >> 3] |= 1 << (x_coord & 0x07);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return true (1-8) if a module is colour, otherwise false (0) */
|
/* Returns true (1-8) if a module is colour, otherwise false (0) */
|
||||||
INTERNAL int module_colour_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord) {
|
INTERNAL int module_colour_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord) {
|
||||||
return symbol->encoded_data[y_coord][x_coord];
|
return symbol->encoded_data[y_coord][x_coord];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set a module to a colour */
|
/* Sets a module to a colour */
|
||||||
INTERNAL void set_module_colour(struct zint_symbol *symbol, const int y_coord, const int x_coord, const int colour) {
|
INTERNAL void set_module_colour(struct zint_symbol *symbol, const int y_coord, const int x_coord, const int colour) {
|
||||||
symbol->encoded_data[y_coord][x_coord] = colour;
|
symbol->encoded_data[y_coord][x_coord] = colour;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set a dark/black module to white (i.e. unset) */
|
/* Sets a dark/black module to white (i.e. unsets) */
|
||||||
INTERNAL void unset_module(struct zint_symbol *symbol, const int y_coord, const int x_coord) {
|
INTERNAL void unset_module(struct zint_symbol *symbol, const int y_coord, const int x_coord) {
|
||||||
symbol->encoded_data[y_coord][x_coord >> 3] &= ~(1 << (x_coord & 0x07));
|
symbol->encoded_data[y_coord][x_coord >> 3] &= ~(1 << (x_coord & 0x07));
|
||||||
}
|
}
|
||||||
@ -255,7 +255,7 @@ INTERNAL void expand(struct zint_symbol *symbol, const char data[], const int le
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Indicates which symbologies can have row binding */
|
/* Whether `symbology` can have row binding */
|
||||||
INTERNAL int is_stackable(const int symbology) {
|
INTERNAL int is_stackable(const int symbology) {
|
||||||
if (symbology < BARCODE_PHARMA_TWO && symbology != BARCODE_POSTNET) {
|
if (symbology < BARCODE_PHARMA_TWO && symbology != BARCODE_POSTNET) {
|
||||||
return 1;
|
return 1;
|
||||||
@ -280,7 +280,7 @@ INTERNAL int is_stackable(const int symbology) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Indicates which symbols can have addon (EAN-2 and EAN-5) */
|
/* Whether `symbology` can have addon (EAN-2 and EAN-5) */
|
||||||
INTERNAL int is_extendable(const int symbology) {
|
INTERNAL int is_extendable(const int symbology) {
|
||||||
|
|
||||||
switch (symbology) {
|
switch (symbology) {
|
||||||
@ -301,12 +301,12 @@ INTERNAL int is_extendable(const int symbology) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Indicates which symbols can have composite 2D component data */
|
/* Whether `symbology` can have composite 2D component data */
|
||||||
INTERNAL int is_composite(const int symbology) {
|
INTERNAL int is_composite(const int symbology) {
|
||||||
return symbology >= BARCODE_EANX_CC && symbology <= BARCODE_DBAR_EXPSTK_CC;
|
return symbology >= BARCODE_EANX_CC && symbology <= BARCODE_DBAR_EXPSTK_CC;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns 1 if symbology is a matrix design renderable as dots */
|
/* Whether `symbology` is a matrix design renderable as dots */
|
||||||
INTERNAL int is_dotty(const int symbology) {
|
INTERNAL int is_dotty(const int symbology) {
|
||||||
|
|
||||||
switch (symbology) {
|
switch (symbology) {
|
||||||
@ -332,7 +332,7 @@ INTERNAL int is_dotty(const int symbology) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns 1 if symbology has fixed aspect ratio (matrix design) */
|
/* Whether `symbology` has a fixed aspect ratio (matrix design) */
|
||||||
INTERNAL int is_fixed_ratio(const int symbology) {
|
INTERNAL int is_fixed_ratio(const int symbology) {
|
||||||
|
|
||||||
if (is_dotty(symbology)) {
|
if (is_dotty(symbology)) {
|
||||||
@ -358,6 +358,16 @@ INTERNAL int is_twodigits(const unsigned char source[], const int length, const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Returns how many consecutive digits lie immediately ahead up to `max`, or all if `max` is -1 */
|
||||||
|
INTERNAL int cnt_digits(const unsigned char source[], const int length, const int position, const int max) {
|
||||||
|
int i;
|
||||||
|
const int max_length = max == -1 || position + max > length ? length : position + max;
|
||||||
|
|
||||||
|
for (i = position; i < max_length && z_isdigit(source[i]); i++);
|
||||||
|
|
||||||
|
return i - position;
|
||||||
|
}
|
||||||
|
|
||||||
/* State machine to decode UTF-8 to Unicode codepoints (state 0 means done, state 12 means error) */
|
/* State machine to decode UTF-8 to Unicode codepoints (state 0 means done, state 12 means error) */
|
||||||
INTERNAL unsigned int decode_utf8(unsigned int *state, unsigned int *codep, const unsigned char byte) {
|
INTERNAL unsigned int decode_utf8(unsigned int *state, unsigned int *codep, const unsigned char byte) {
|
||||||
/*
|
/*
|
||||||
@ -419,8 +429,8 @@ INTERNAL int is_valid_utf8(const unsigned char source[], const int length) {
|
|||||||
return state == 0;
|
return state == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert UTF-8 to Unicode. If `disallow_4byte` unset, allow all values (UTF-32). If `disallow_4byte` set,
|
/* Converts UTF-8 to Unicode. If `disallow_4byte` unset, allows all values (UTF-32). If `disallow_4byte` set,
|
||||||
* only allow codepoints <= U+FFFF (ie four-byte sequences not allowed) (UTF-16, no surrogates) */
|
* only allows codepoints <= U+FFFF (ie four-byte sequences not allowed) (UTF-16, no surrogates) */
|
||||||
INTERNAL int utf8_to_unicode(struct zint_symbol *symbol, const unsigned char source[], unsigned int vals[],
|
INTERNAL int utf8_to_unicode(struct zint_symbol *symbol, const unsigned char source[], unsigned int vals[],
|
||||||
int *length, const int disallow_4byte) {
|
int *length, const int disallow_4byte) {
|
||||||
int bpos;
|
int bpos;
|
||||||
@ -453,7 +463,7 @@ INTERNAL int utf8_to_unicode(struct zint_symbol *symbol, const unsigned char sou
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set symbol height, returning a warning if not within minimum and/or maximum if given.
|
/* Sets symbol height, returning a warning if not within minimum and/or maximum if given.
|
||||||
`default_height` does not include height of fixed-height rows (i.e. separators/composite data) */
|
`default_height` does not include height of fixed-height rows (i.e. separators/composite data) */
|
||||||
INTERNAL int set_height(struct zint_symbol *symbol, const float min_row_height, const float default_height,
|
INTERNAL int set_height(struct zint_symbol *symbol, const float min_row_height, const float default_height,
|
||||||
const float max_height, const int no_errtxt) {
|
const float max_height, const int no_errtxt) {
|
||||||
@ -535,7 +545,7 @@ INTERNAL int segs_length(const struct zint_seg segs[], const int seg_count) {
|
|||||||
return total_len;
|
return total_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Shallow copy segments, adjusting default ECIs */
|
/* Shallow copies segments, adjusting default ECIs */
|
||||||
INTERNAL void segs_cpy(const struct zint_symbol *symbol, const struct zint_seg segs[], const int seg_count,
|
INTERNAL void segs_cpy(const struct zint_symbol *symbol, const struct zint_seg segs[], const int seg_count,
|
||||||
struct zint_seg local_segs[]) {
|
struct zint_seg local_segs[]) {
|
||||||
const int default_eci = symbol->symbology == BARCODE_GRIDMATRIX ? 29 : symbol->symbology == BARCODE_UPNQR ? 4 : 3;
|
const int default_eci = symbol->symbology == BARCODE_GRIDMATRIX ? 29 : symbol->symbology == BARCODE_UPNQR ? 4 : 3;
|
||||||
|
157
backend/common.h
157
backend/common.h
@ -90,7 +90,7 @@ typedef unsigned __int64 uint64_t;
|
|||||||
/* The most commonly used set */
|
/* The most commonly used set */
|
||||||
#define NEON_F IS_NUM_F /* NEON "0123456789" */
|
#define NEON_F IS_NUM_F /* NEON "0123456789" */
|
||||||
|
|
||||||
/* Simple versions of <cctype> functions with no dependence on locale */
|
/* Simple versions of <ctype.h> functions with no dependence on locale */
|
||||||
#define z_isdigit(c) ((c) <= '9' && (c) >= '0')
|
#define z_isdigit(c) ((c) <= '9' && (c) >= '0')
|
||||||
#define z_isupper(c) ((c) >= 'A' && (c) <= 'Z')
|
#define z_isupper(c) ((c) >= 'A' && (c) <= 'Z')
|
||||||
#define z_islower(c) ((c) >= 'a' && (c) <= 'z')
|
#define z_islower(c) ((c) >= 'a' && (c) <= 'z')
|
||||||
@ -146,75 +146,144 @@ typedef unsigned __int64 uint64_t;
|
|||||||
#define Z_COMMON_INLINE 1
|
#define Z_COMMON_INLINE 1
|
||||||
|
|
||||||
#ifdef Z_COMMON_INLINE
|
#ifdef Z_COMMON_INLINE
|
||||||
/* Return true (1) if a module is dark/black, otherwise false (0) */
|
/* Returns true (1) if a module is dark/black, otherwise false (0) */
|
||||||
# define module_is_set(s, y, x) (((s)->encoded_data[(y)][(x) >> 3] >> ((x) & 0x07)) & 1)
|
# define module_is_set(s, y, x) (((s)->encoded_data[(y)][(x) >> 3] >> ((x) & 0x07)) & 1)
|
||||||
|
|
||||||
/* Set a module to dark/black */
|
/* Sets a module to dark/black */
|
||||||
# define set_module(s, y, x) do { (s)->encoded_data[(y)][(x) >> 3] |= 1 << ((x) & 0x07); } while (0)
|
# define set_module(s, y, x) do { (s)->encoded_data[(y)][(x) >> 3] |= 1 << ((x) & 0x07); } while (0)
|
||||||
|
|
||||||
/* Return true (1-8) if a module is colour, otherwise false (0) */
|
/* Returns true (1-8) if a module is colour, otherwise false (0) */
|
||||||
# define module_colour_is_set(s, y, x) ((s)->encoded_data[(y)][(x)])
|
# define module_colour_is_set(s, y, x) ((s)->encoded_data[(y)][(x)])
|
||||||
|
|
||||||
/* Set a module to a colour */
|
/* Sets a module to a colour */
|
||||||
# define set_module_colour(s, y, x, c) do { (s)->encoded_data[(y)][(x)] = (c); } while (0)
|
# define set_module_colour(s, y, x, c) do { (s)->encoded_data[(y)][(x)] = (c); } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
INTERNAL int ctoi(const char source);
|
/* Converts a character 0-9, A-F to its equivalent integer value */
|
||||||
INTERNAL char itoc(const int source);
|
INTERNAL int ctoi(const char source);
|
||||||
INTERNAL int to_int(const unsigned char source[], const int length);
|
|
||||||
INTERNAL void to_upper(unsigned char source[], const int length);
|
|
||||||
INTERNAL int chr_cnt(const unsigned char string[], const int length, const unsigned char c);
|
|
||||||
|
|
||||||
INTERNAL int is_chr(const unsigned int flg, const unsigned int c);
|
/* Converts an integer value to its hexadecimal character */
|
||||||
INTERNAL int is_sane(const unsigned int flg, const unsigned char source[], const int length);
|
INTERNAL char itoc(const int source);
|
||||||
INTERNAL int is_sane_lookup(const char test_string[], const int test_length, const unsigned char source[],
|
|
||||||
|
/* Converts decimal string of length <= 9 to integer value. Returns -1 if not numeric */
|
||||||
|
INTERNAL int to_int(const unsigned char source[], const int length);
|
||||||
|
|
||||||
|
/* Converts lower case characters to upper case in string `source` */
|
||||||
|
INTERNAL void to_upper(unsigned char source[], const int length);
|
||||||
|
|
||||||
|
/* Returns the number of times a character occurs in `source` */
|
||||||
|
INTERNAL int chr_cnt(const unsigned char source[], const int length, const unsigned char c);
|
||||||
|
|
||||||
|
|
||||||
|
/* Whether a character matches `flg` */
|
||||||
|
INTERNAL int is_chr(const unsigned int flg, const unsigned int c);
|
||||||
|
|
||||||
|
/* Verifies that a string only uses valid characters */
|
||||||
|
INTERNAL int is_sane(const unsigned int flg, const unsigned char source[], const int length);
|
||||||
|
|
||||||
|
/* Verifies that a string only uses valid characters, and returns `test_string` position of each in `posns` array */
|
||||||
|
INTERNAL int is_sane_lookup(const char test_string[], const int test_length, const unsigned char source[],
|
||||||
const int length, int *posns);
|
const int length, int *posns);
|
||||||
INTERNAL int posn(const char set_string[], const char data);
|
|
||||||
|
|
||||||
INTERNAL int bin_append_posn(const int arg, const int length, char *binary, const int bin_posn);
|
/* Returns the position of `data` in `set_string` */
|
||||||
|
INTERNAL int posn(const char set_string[], const char data);
|
||||||
|
|
||||||
#ifndef Z_COMMON_INLINE
|
|
||||||
INTERNAL int module_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord);
|
/* Converts `arg` to a string representing its binary equivalent of length `length` and places in `binary` at
|
||||||
INTERNAL void set_module(struct zint_symbol *symbol, const int y_coord, const int x_coord);
|
`bin_posn`. Returns `bin_posn` + `length` */
|
||||||
INTERNAL int module_colour_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord);
|
INTERNAL int bin_append_posn(const int arg, const int length, char *binary, const int bin_posn);
|
||||||
INTERNAL void set_module_colour(struct zint_symbol *symbol, const int y_coord, const int x_coord,
|
|
||||||
|
|
||||||
|
#ifndef Z_COMMON_INLINE
|
||||||
|
/* Returns true (1) if a module is dark/black, otherwise false (0) */
|
||||||
|
INTERNAL int module_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord);
|
||||||
|
|
||||||
|
/* Sets a module to dark/black */
|
||||||
|
INTERNAL void set_module(struct zint_symbol *symbol, const int y_coord, const int x_coord);
|
||||||
|
|
||||||
|
/* Returns true (1-8) if a module is colour, otherwise false (0) */
|
||||||
|
INTERNAL int module_colour_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord);
|
||||||
|
|
||||||
|
/* Sets a module to a colour */
|
||||||
|
INTERNAL void set_module_colour(struct zint_symbol *symbol, const int y_coord, const int x_coord,
|
||||||
const int colour);
|
const int colour);
|
||||||
#endif
|
#endif
|
||||||
INTERNAL void unset_module(struct zint_symbol *symbol, const int y_coord, const int x_coord);
|
/* Sets a dark/black module to white (i.e. unsets) */
|
||||||
|
INTERNAL void unset_module(struct zint_symbol *symbol, const int y_coord, const int x_coord);
|
||||||
|
|
||||||
INTERNAL void expand(struct zint_symbol *symbol, const char data[], const int length);
|
/* Expands from a width pattern to a bit pattern */
|
||||||
|
INTERNAL void expand(struct zint_symbol *symbol, const char data[], const int length);
|
||||||
|
|
||||||
INTERNAL int is_stackable(const int symbology);
|
|
||||||
INTERNAL int is_extendable(const int symbology);
|
|
||||||
INTERNAL int is_composite(const int symbology);
|
|
||||||
INTERNAL int is_dotty(const int symbology);
|
|
||||||
INTERNAL int is_fixed_ratio(const int symbology);
|
|
||||||
|
|
||||||
INTERNAL int is_twodigits(const unsigned char source[], const int length, const int position);
|
/* Whether `symbology` can have row binding */
|
||||||
|
INTERNAL int is_stackable(const int symbology);
|
||||||
|
|
||||||
INTERNAL unsigned int decode_utf8(unsigned int *state, unsigned int *codep, const unsigned char byte);
|
/* Whether `symbology` can have addon (EAN-2 and EAN-5) */
|
||||||
INTERNAL int is_valid_utf8(const unsigned char source[], const int length);
|
INTERNAL int is_extendable(const int symbology);
|
||||||
INTERNAL int utf8_to_unicode(struct zint_symbol *symbol, const unsigned char source[], unsigned int vals[],
|
|
||||||
|
/* Whether `symbology` can have composite 2D component data */
|
||||||
|
INTERNAL int is_composite(const int symbology);
|
||||||
|
|
||||||
|
/* Whether `symbology` is a matrix design renderable as dots */
|
||||||
|
INTERNAL int is_dotty(const int symbology);
|
||||||
|
|
||||||
|
/* Whether `symbology` has a fixed aspect ratio (matrix design) */
|
||||||
|
INTERNAL int is_fixed_ratio(const int symbology);
|
||||||
|
|
||||||
|
|
||||||
|
/* Whether next two characters are digits */
|
||||||
|
INTERNAL int is_twodigits(const unsigned char source[], const int length, const int position);
|
||||||
|
|
||||||
|
/* Returns how many consecutive digits lie immediately ahead up to `max`, or all if `max` is -1 */
|
||||||
|
INTERNAL int cnt_digits(const unsigned char source[], const int length, const int position, const int max);
|
||||||
|
|
||||||
|
|
||||||
|
/* State machine to decode UTF-8 to Unicode codepoints (state 0 means done, state 12 means error) */
|
||||||
|
INTERNAL unsigned int decode_utf8(unsigned int *state, unsigned int *codep, const unsigned char byte);
|
||||||
|
|
||||||
|
/* Is string valid UTF-8? */
|
||||||
|
INTERNAL int is_valid_utf8(const unsigned char source[], const int length);
|
||||||
|
|
||||||
|
/* Converts UTF-8 to Unicode. If `disallow_4byte` unset, allows all values (UTF-32). If `disallow_4byte` set,
|
||||||
|
* only allows codepoints <= U+FFFF (ie four-byte sequences not allowed) (UTF-16, no surrogates) */
|
||||||
|
INTERNAL int utf8_to_unicode(struct zint_symbol *symbol, const unsigned char source[], unsigned int vals[],
|
||||||
int *length, const int disallow_4byte);
|
int *length, const int disallow_4byte);
|
||||||
|
|
||||||
INTERNAL int set_height(struct zint_symbol *symbol, const float min_row_height, const float default_height,
|
|
||||||
|
/* Sets symbol height, returning a warning if not within minimum and/or maximum if given.
|
||||||
|
`default_height` does not include height of fixed-height rows (i.e. separators/composite data) */
|
||||||
|
INTERNAL int set_height(struct zint_symbol *symbol, const float min_row_height, const float default_height,
|
||||||
const float max_height, const int set_errtxt);
|
const float max_height, const int set_errtxt);
|
||||||
|
|
||||||
INTERNAL float stripf(const float arg);
|
|
||||||
|
|
||||||
INTERNAL int segs_length(const struct zint_seg segs[], const int seg_count);
|
/* Removes excess precision from floats - see https://stackoverflow.com/q/503436 */
|
||||||
INTERNAL void segs_cpy(const struct zint_symbol *symbol, const struct zint_seg segs[], const int seg_count,
|
INTERNAL float stripf(const float arg);
|
||||||
|
|
||||||
|
|
||||||
|
/* Returns total length of segments */
|
||||||
|
INTERNAL int segs_length(const struct zint_seg segs[], const int seg_count);
|
||||||
|
|
||||||
|
/* Shallow copies segments, adjusting default ECIs */
|
||||||
|
INTERNAL void segs_cpy(const struct zint_symbol *symbol, const struct zint_seg segs[], const int seg_count,
|
||||||
struct zint_seg local_segs[]);
|
struct zint_seg local_segs[]);
|
||||||
|
|
||||||
INTERNAL int colour_to_red(const int colour);
|
|
||||||
INTERNAL int colour_to_green(const int colour);
|
|
||||||
INTERNAL int colour_to_blue(const int colour);
|
|
||||||
|
|
||||||
#ifdef ZINT_TEST
|
/* Returns red component if any of ultra colour indexing "0CBMRYGKW" */
|
||||||
INTERNAL void debug_test_codeword_dump(struct zint_symbol *symbol, const unsigned char *codewords,
|
INTERNAL int colour_to_red(const int colour);
|
||||||
const int length);
|
|
||||||
INTERNAL void debug_test_codeword_dump_int(struct zint_symbol *symbol, const int *codewords, const int length);
|
/* Returns green component if any of ultra colour indexing "0CBMRYGKW" */
|
||||||
#endif
|
INTERNAL int colour_to_green(const int colour);
|
||||||
|
|
||||||
|
/* Returns blue component if any of ultra colour indexing "0CBMRYGKW" */
|
||||||
|
INTERNAL int colour_to_blue(const int colour);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef ZINT_TEST
|
||||||
|
/* Dumps hex-formatted codewords in symbol->errtxt (for use in testing) */
|
||||||
|
INTERNAL void debug_test_codeword_dump(struct zint_symbol *symbol, const unsigned char *codewords, const int length);
|
||||||
|
/* Dumps decimal-formatted codewords in symbol->errtxt (for use in testing) */
|
||||||
|
INTERNAL void debug_test_codeword_dump_int(struct zint_symbol *symbol, const int *codewords, const int length);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -301,7 +301,7 @@ static void cc_b(struct zint_symbol *symbol, const char source[], const int cc_w
|
|||||||
const int length = (int) strlen(source) / 8;
|
const int length = (int) strlen(source) / 8;
|
||||||
int i;
|
int i;
|
||||||
unsigned char *data_string = (unsigned char *) z_alloca(length + 3);
|
unsigned char *data_string = (unsigned char *) z_alloca(length + 3);
|
||||||
int chainemc[180], mclength;
|
int chainemc[180], mclength = 0;
|
||||||
int k, j, p, longueur, mccorrection[50] = {0}, offset;
|
int k, j, p, longueur, mccorrection[50] = {0}, offset;
|
||||||
int total;
|
int total;
|
||||||
char pattern[580];
|
char pattern[580];
|
||||||
@ -322,11 +322,8 @@ static void cc_b(struct zint_symbol *symbol, const char source[], const int cc_w
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mclength = 0;
|
|
||||||
|
|
||||||
/* "the CC-B component shall have codeword 920 in the first symbol character position" (section 9a) */
|
/* "the CC-B component shall have codeword 920 in the first symbol character position" (section 9a) */
|
||||||
chainemc[mclength] = 920;
|
chainemc[mclength++] = 920;
|
||||||
mclength++;
|
|
||||||
|
|
||||||
pdf_byteprocess(chainemc, &mclength, data_string, 0, length, 0, debug_print);
|
pdf_byteprocess(chainemc, &mclength, data_string, 0, length, 0, debug_print);
|
||||||
|
|
||||||
@ -410,8 +407,7 @@ static void cc_b(struct zint_symbol *symbol, const char source[], const int cc_w
|
|||||||
|
|
||||||
/* Binary input padded to target length so no padding should be necessary */
|
/* Binary input padded to target length so no padding should be necessary */
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
chainemc[mclength] = 900; /* Not reached */
|
chainemc[mclength++] = 900; /* Not reached */
|
||||||
mclength++;
|
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,8 +431,7 @@ static void cc_b(struct zint_symbol *symbol, const char source[], const int cc_w
|
|||||||
}
|
}
|
||||||
/* we add these codes to the string */
|
/* we add these codes to the string */
|
||||||
for (i = k - 1; i >= 0; i--) {
|
for (i = k - 1; i >= 0; i--) {
|
||||||
chainemc[mclength] = mccorrection[i];
|
chainemc[mclength++] = mccorrection[i];
|
||||||
mclength++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now get the RAP (Row Address Pattern) start values */
|
/* Now get the RAP (Row Address Pattern) start values */
|
||||||
@ -522,7 +517,7 @@ static void cc_c(struct zint_symbol *symbol, const char source[], const int cc_w
|
|||||||
const int length = (int) strlen(source) / 8;
|
const int length = (int) strlen(source) / 8;
|
||||||
int i, p;
|
int i, p;
|
||||||
unsigned char *data_string = (unsigned char *) z_alloca(length + 4);
|
unsigned char *data_string = (unsigned char *) z_alloca(length + 4);
|
||||||
int chainemc[1000], mclength, k;
|
int chainemc[1000], mclength = 0, k;
|
||||||
int offset, longueur, loop, total, j, mccorrection[520] = {0};
|
int offset, longueur, loop, total, j, mccorrection[520] = {0};
|
||||||
int c1, c2, c3, dummy[35];
|
int c1, c2, c3, dummy[35];
|
||||||
char pattern[580];
|
char pattern[580];
|
||||||
@ -540,12 +535,8 @@ static void cc_c(struct zint_symbol *symbol, const char source[], const int cc_w
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mclength = 0;
|
chainemc[mclength++] = 0; /* space for length descriptor */
|
||||||
|
chainemc[mclength++] = 920; /* CC-C identifier */
|
||||||
chainemc[mclength] = 0; /* space for length descriptor */
|
|
||||||
mclength++;
|
|
||||||
chainemc[mclength] = 920; /* CC-C identifier */
|
|
||||||
mclength++;
|
|
||||||
|
|
||||||
pdf_byteprocess(chainemc, &mclength, data_string, 0, length, 0, debug_print);
|
pdf_byteprocess(chainemc, &mclength, data_string, 0, length, 0, debug_print);
|
||||||
|
|
||||||
@ -603,8 +594,7 @@ static void cc_c(struct zint_symbol *symbol, const char source[], const int cc_w
|
|||||||
}
|
}
|
||||||
/* we add these codes to the string */
|
/* we add these codes to the string */
|
||||||
for (i = k - 1; i >= 0; i--) {
|
for (i = k - 1; i >= 0; i--) {
|
||||||
chainemc[mclength] = mccorrection[i];
|
chainemc[mclength++] = mccorrection[i];
|
||||||
mclength++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 818 - The CW string is finished */
|
/* 818 - The CW string is finished */
|
||||||
|
@ -758,7 +758,9 @@ static int dm_getEndMode(struct zint_symbol *symbol, const unsigned char *source
|
|||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*#define DM_TRACE*/
|
#if 0
|
||||||
|
#define DM_TRACE
|
||||||
|
#endif
|
||||||
#include "dmatrix_trace.h"
|
#include "dmatrix_trace.h"
|
||||||
|
|
||||||
/* Return number of C40/TEXT codewords needed to encode characters in full batches of 3 (or less if EOD).
|
/* Return number of C40/TEXT codewords needed to encode characters in full batches of 3 (or less if EOD).
|
||||||
|
@ -52,6 +52,7 @@ static void DM_TRACE_VertexToString(const unsigned char *source, const int lengt
|
|||||||
printf("char '%c' at %d mode %s", source[position], position, dm_smodes[edge->mode]);
|
printf("char '%c' at %d mode %s", source[position], position, dm_smodes[edge->mode]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DM_TRACE_EdgeToString(char *buf, const unsigned char *source, const int length, struct dm_edge *edges,
|
static void DM_TRACE_EdgeToString(char *buf, const unsigned char *source, const int length, struct dm_edge *edges,
|
||||||
struct dm_edge *edge) {
|
struct dm_edge *edge) {
|
||||||
int previousMode = DM_TRACE_getPreviousMode(edges, edge);
|
int previousMode = DM_TRACE_getPreviousMode(edges, edge);
|
||||||
|
@ -409,21 +409,12 @@ static int dc_datum_c(const unsigned char source[], const int length, const int
|
|||||||
return is_twodigits(source, length, position);
|
return is_twodigits(source, length, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns how many consecutive digits lie immediately ahead (Annex F.II.A) */
|
|
||||||
static int dc_n_digits(const unsigned char source[], const int length, const int position, const int max) {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = position; (i < length) && z_isdigit(source[i]) && (i < position + max); i++);
|
|
||||||
|
|
||||||
return i - position;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Checks ahead for 10 or more digits starting "17xxxxxx10..." (Annex F.II.B) */
|
/* Checks ahead for 10 or more digits starting "17xxxxxx10..." (Annex F.II.B) */
|
||||||
static int dc_seventeen_ten(const unsigned char source[], const int length, const int position) {
|
static int dc_seventeen_ten(const unsigned char source[], const int length, const int position) {
|
||||||
|
|
||||||
if (position + 9 < length && source[position] == '1' && source[position + 1] == '7'
|
if (position + 9 < length && source[position] == '1' && source[position + 1] == '7'
|
||||||
&& source[position + 8] == '1' && source[position + 9] == '0'
|
&& source[position + 8] == '1' && source[position + 9] == '0'
|
||||||
&& dc_n_digits(source, length, position + 2, 6) >= 6) {
|
&& cnt_digits(source, length, position + 2, 6) >= 6) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +438,7 @@ static int dc_ahead_c(const unsigned char source[], const int length, const int
|
|||||||
/* Annex F.II.F */
|
/* Annex F.II.F */
|
||||||
static int dc_try_c(const unsigned char source[], const int length, const int position) {
|
static int dc_try_c(const unsigned char source[], const int length, const int position) {
|
||||||
|
|
||||||
if (position < length && z_isdigit(source[position])) { /* dc_n_digits(position) > 0 */
|
if (position < length && z_isdigit(source[position])) { /* cnt_digits(position) > 0 */
|
||||||
const int ahead_c_position = dc_ahead_c(source, length, position);
|
const int ahead_c_position = dc_ahead_c(source, length, position);
|
||||||
if (ahead_c_position > dc_ahead_c(source, length, position + 1)) {
|
if (ahead_c_position > dc_ahead_c(source, length, position + 1)) {
|
||||||
return ahead_c_position;
|
return ahead_c_position;
|
||||||
@ -681,7 +672,7 @@ static int dc_encode_message(struct zint_symbol *symbol, const unsigned char sou
|
|||||||
|
|
||||||
/* Step C3 */
|
/* Step C3 */
|
||||||
if (dc_binary(source, length, position)) {
|
if (dc_binary(source, length, position)) {
|
||||||
/* dc_n_digits(position + 1) > 0 */
|
/* cnt_digits(position + 1) > 0 */
|
||||||
if (position + 1 < length && z_isdigit(source[position + 1])) {
|
if (position + 1 < length && z_isdigit(source[position + 1])) {
|
||||||
if ((source[position] - 128) < 32) {
|
if ((source[position] - 128) < 32) {
|
||||||
codeword_array[ap++] = 110; /* Upper Shift A */
|
codeword_array[ap++] = 110; /* Upper Shift A */
|
||||||
|
@ -336,6 +336,8 @@ static int hibc(struct zint_symbol *symbol, struct zint_seg segs[], const int se
|
|||||||
segs[0].source = (unsigned char *) to_process;
|
segs[0].source = (unsigned char *) to_process;
|
||||||
segs[0].length = length;
|
segs[0].length = length;
|
||||||
|
|
||||||
|
if (symbol->debug & ZINT_DEBUG_PRINT) printf("HIBC processed source: %s\n", to_process);
|
||||||
|
|
||||||
switch (symbol->symbology) {
|
switch (symbol->symbology) {
|
||||||
case BARCODE_HIBC_128:
|
case BARCODE_HIBC_128:
|
||||||
error_number = code128(symbol, segs[0].source, segs[0].length);
|
error_number = code128(symbol, segs[0].source, segs[0].length);
|
||||||
|
1123
backend/pdf417.c
1123
backend/pdf417.c
File diff suppressed because it is too large
Load Diff
@ -45,7 +45,7 @@ INTERNAL_DATA_EXTERN const unsigned short pdf_bitpattern[2787];
|
|||||||
INTERNAL_DATA_EXTERN const unsigned short pdf_Microcoeffs[344];
|
INTERNAL_DATA_EXTERN const unsigned short pdf_Microcoeffs[344];
|
||||||
|
|
||||||
/* rows, columns, error codewords, k-offset of valid MicroPDF417 sizes from ISO/IEC 24728:2006 */
|
/* rows, columns, error codewords, k-offset of valid MicroPDF417 sizes from ISO/IEC 24728:2006 */
|
||||||
INTERNAL_DATA_EXTERN const unsigned short pdf_MicroVariants[170];
|
INTERNAL_DATA_EXTERN const unsigned short pdf_MicroVariants[136];
|
||||||
|
|
||||||
/* following is Left RAP, Centre RAP, Right RAP and Start Cluster from ISO/IEC 24728:2006 tables 10, 11 and 12 */
|
/* following is Left RAP, Centre RAP, Right RAP and Start Cluster from ISO/IEC 24728:2006 tables 10, 11 and 12 */
|
||||||
INTERNAL_DATA_EXTERN const char pdf_RAPTable[136];
|
INTERNAL_DATA_EXTERN const char pdf_RAPTable[136];
|
||||||
@ -56,8 +56,8 @@ INTERNAL_DATA_EXTERN const unsigned short pdf_rap_side[52];
|
|||||||
/* Centre Row Address Pattern from Table 2 */
|
/* Centre Row Address Pattern from Table 2 */
|
||||||
INTERNAL_DATA_EXTERN const unsigned short pdf_rap_centre[52];
|
INTERNAL_DATA_EXTERN const unsigned short pdf_rap_centre[52];
|
||||||
|
|
||||||
INTERNAL void pdf_byteprocess(int *chainemc, int *mclength, const unsigned char chaine[], int start, const int length,
|
INTERNAL void pdf_byteprocess(int *chainemc, int *p_mclength, const unsigned char chaine[], int start,
|
||||||
const int lastmode, const int debug);
|
const int length, const int lastmode, const int debug);
|
||||||
|
|
||||||
/* vim: set ts=4 sw=4 et : */
|
/* vim: set ts=4 sw=4 et : */
|
||||||
#endif /* Z_PDF417_H */
|
#endif /* Z_PDF417_H */
|
||||||
|
@ -474,7 +474,7 @@ INTERNAL_DATA const unsigned short pdf_Microcoeffs[344] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* rows, columns, error codewords, k-offset of valid MicroPDF417 sizes from ISO/IEC 24728:2006 */
|
/* rows, columns, error codewords, k-offset of valid MicroPDF417 sizes from ISO/IEC 24728:2006 */
|
||||||
INTERNAL_DATA const unsigned short pdf_MicroVariants[170] = {
|
INTERNAL_DATA const unsigned short pdf_MicroVariants[136] = { /*34*4*/
|
||||||
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||||
11, 14, 17, 20, 24, 28, 8, 11, 14, 17, 20, 23, 26, 6, 8, 10, 12, 15, 20, 26, 32, 38, 44, 4, 6, 8, 10, 12, 15, 20, 26, 32, 38, 44,
|
11, 14, 17, 20, 24, 28, 8, 11, 14, 17, 20, 23, 26, 6, 8, 10, 12, 15, 20, 26, 32, 38, 44, 4, 6, 8, 10, 12, 15, 20, 26, 32, 38, 44,
|
||||||
7, 7, 7, 8, 8, 8, 8, 9, 9, 10, 11, 13, 15, 12, 14, 16, 18, 21, 26, 32, 38, 44, 50, 8, 12, 14, 16, 18, 21, 26, 32, 38, 44, 50,
|
7, 7, 7, 8, 8, 8, 8, 9, 9, 10, 11, 13, 15, 12, 14, 16, 18, 21, 26, 32, 38, 44, 50, 8, 12, 14, 16, 18, 21, 26, 32, 38, 44, 50,
|
||||||
@ -483,7 +483,7 @@ INTERNAL_DATA const unsigned short pdf_MicroVariants[170] = {
|
|||||||
/* rows, columns, error codewords, k-offset */
|
/* rows, columns, error codewords, k-offset */
|
||||||
|
|
||||||
/* following is Left RAP, Centre RAP, Right RAP and Start Cluster from ISO/IEC 24728:2006 tables 10, 11 and 12 */
|
/* following is Left RAP, Centre RAP, Right RAP and Start Cluster from ISO/IEC 24728:2006 tables 10, 11 and 12 */
|
||||||
INTERNAL_DATA const char pdf_RAPTable[136] = {
|
INTERNAL_DATA const char pdf_RAPTable[136] = { /*34*4*/
|
||||||
1, 8, 36, 19, 9, 25, 1, 1, 8, 36, 19, 9, 27, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1, 47, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1,
|
1, 8, 36, 19, 9, 25, 1, 1, 8, 36, 19, 9, 27, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1, 47, 1, 7, 15, 25, 37, 1, 1, 21, 15, 1,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25, 19, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25, 19, 1, 7, 15, 25, 37, 17, 9, 29, 31, 25,
|
||||||
9, 8, 36, 19, 17, 33, 1, 9, 8, 36, 19, 17, 35, 1, 7, 15, 25, 37, 33, 17, 37, 47, 49, 43, 1, 7, 15, 25, 37, 33, 17, 37, 47, 49,
|
9, 8, 36, 19, 17, 33, 1, 9, 8, 36, 19, 17, 35, 1, 7, 15, 25, 37, 33, 17, 37, 47, 49, 43, 1, 7, 15, 25, 37, 33, 17, 37, 47, 49,
|
||||||
|
136
backend/pdf417_trace.h
Normal file
136
backend/pdf417_trace.h
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
/* pdf417_trace.h - Trace routines for optimal PDF417 optimization algorithm */
|
||||||
|
/*
|
||||||
|
libzint - the open source barcode library
|
||||||
|
Copyright (C) 2022 Robin Stuart <rstuart114@gmail.com>
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
3. Neither the name of the project nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||||
|
|
||||||
|
#ifndef Z_PDF417_TRACE_H
|
||||||
|
#define Z_PDF417_TRACE_H
|
||||||
|
|
||||||
|
#ifndef PDF_TRACE
|
||||||
|
#define PDF_TRACE_Edges(px, s, l, p, v)
|
||||||
|
#define PDF_TRACE_AddEdge(s, l, es, p, v, t, e) do { (void)(s); (void)(l); } while (0)
|
||||||
|
#define PDF_TRACE_NotAddEdge(s, l, es, p, v, t, e) do { (void)(s); (void)(l); } while (0)
|
||||||
|
#else
|
||||||
|
|
||||||
|
static int PDF_TRACE_getPreviousMode(struct pdf_edge *edges, struct pdf_edge *edge) {
|
||||||
|
struct pdf_edge *previous = PDF_PREVIOUS(edges, edge);
|
||||||
|
return previous == NULL ? PDF_ALP : previous->mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void PDF_TRACE_EdgeToString(char *buf, const unsigned char *source, const int length, struct pdf_edge *edges,
|
||||||
|
struct pdf_edge *edge) {
|
||||||
|
int previousMode = PDF_TRACE_getPreviousMode(edges, edge);
|
||||||
|
(void)length;
|
||||||
|
if (buf) {
|
||||||
|
sprintf(buf, "%d_%c %c(%d,%d) %d(%d,%d,%d) -> %d_%c",
|
||||||
|
edge->from, pdf_smodes[previousMode], pdf_smodes[edge->mode], source[edge->from], edge->len, edge->size
|
||||||
|
+ edge->unit_size, edge->units, edge->unit_size, edge->size, edge->from + 1, pdf_smodes[edge->mode]);
|
||||||
|
} else {
|
||||||
|
printf("%d_%c %c(%d,%d) %d(%d,%d,%d) -> %d_%c",
|
||||||
|
edge->from, pdf_smodes[previousMode], pdf_smodes[edge->mode], source[edge->from], edge->len, edge->size
|
||||||
|
+ edge->unit_size, edge->units, edge->unit_size, edge->size, edge->from + 1, pdf_smodes[edge->mode]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void PDF_TRACE_Path(const unsigned char *source, const int length, struct pdf_edge *edges,
|
||||||
|
struct pdf_edge *edge, char *result, const int result_size) {
|
||||||
|
PDF_TRACE_EdgeToString(result, source, length, edges, edge);
|
||||||
|
struct pdf_edge *current = PDF_PREVIOUS(edges, edge);
|
||||||
|
while (current) {
|
||||||
|
char s[256];
|
||||||
|
char *pos;
|
||||||
|
int len;
|
||||||
|
PDF_TRACE_EdgeToString(s, source, length, edges, current);
|
||||||
|
pos = strrchr(s, ' ');
|
||||||
|
assert(pos);
|
||||||
|
len = strlen(result);
|
||||||
|
if ((pos - s) + 1 + len + 1 >= result_size) {
|
||||||
|
result[result_size - 4] = '\0';
|
||||||
|
strcat(result, "...");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
memmove(result + (pos - s) + 1, result, len + 1);
|
||||||
|
memcpy(result, s, (pos - s) + 1);
|
||||||
|
current = PDF_PREVIOUS(edges, current);
|
||||||
|
}
|
||||||
|
puts(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void PDF_TRACE_Edges(const char *prefix, const unsigned char *source, const int length,
|
||||||
|
struct pdf_edge *edges, const int vertexIndex) {
|
||||||
|
int i, j, e_i;
|
||||||
|
char result[1024 * 2];
|
||||||
|
if (vertexIndex) {
|
||||||
|
printf(prefix, vertexIndex);
|
||||||
|
} else {
|
||||||
|
fputs(prefix, stdout);
|
||||||
|
}
|
||||||
|
for (i = vertexIndex; i <= length; i++) {
|
||||||
|
e_i = i * PDF_NUM_MODES;
|
||||||
|
for (j = 0; j < PDF_NUM_MODES; j++) {
|
||||||
|
if (edges[e_i + j].mode) {
|
||||||
|
fputs(" **** ", stdout);
|
||||||
|
PDF_TRACE_Path(source, length, edges, edges + e_i + j, result, (int) ARRAY_SIZE(result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void PDF_TRACE_AddEdge(const unsigned char *source, const int length, struct pdf_edge *edges,
|
||||||
|
struct pdf_edge *previous, const int vertexIndex, const int t_table, struct pdf_edge *edge) {
|
||||||
|
const int new_size = edge->size + edge->unit_size;
|
||||||
|
const int v_ij = vertexIndex * PDF_NUM_MODES + edge->mode - 1;
|
||||||
|
const int v_size = edges[v_ij].size + edges[v_ij].unit_size;
|
||||||
|
|
||||||
|
(void)source; (void)length;
|
||||||
|
|
||||||
|
printf("add mode %c, t_table 0x%X, previous %d, from %d, len %d, v_ij %d, %d(%d,%d,%d) > %d(%d,%d,%d)\n",
|
||||||
|
pdf_smodes[edge->mode], t_table, previous ? (int) (previous - edges) : 0, edge->from, edge->len, v_ij,
|
||||||
|
v_size, edges[v_ij].units, edges[v_ij].unit_size, edges[v_ij].size,
|
||||||
|
new_size, edge->units, edge->unit_size, edge->size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void PDF_TRACE_NotAddEdge(const unsigned char *source, const int length, struct pdf_edge *edges,
|
||||||
|
struct pdf_edge *previous, const int vertexIndex, const int t_table, struct pdf_edge *edge) {
|
||||||
|
const int new_size = edge->size + edge->unit_size;
|
||||||
|
const int v_ij = vertexIndex * PDF_NUM_MODES + edge->mode - 1;
|
||||||
|
const int v_size = edges[v_ij].size + edges[v_ij].unit_size;
|
||||||
|
|
||||||
|
(void)source; (void)length;
|
||||||
|
|
||||||
|
printf("NOT mode %c, t_table %d, previous %d, from %d, len %d, v_ij %d, %d(%d,%d,%d) <= %d(%d,%d,%d)\n",
|
||||||
|
pdf_smodes[edge->mode], t_table, previous ? (int) (previous - edges) : 0, edge->from, edge->len, v_ij,
|
||||||
|
v_size, edges[v_ij].units, edges[v_ij].unit_size, edges[v_ij].size,
|
||||||
|
new_size, edge->units, edge->unit_size, edge->size);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* PDF_TRACE */
|
||||||
|
/* vim: set ts=4 sw=4 et : */
|
||||||
|
#endif /* Z_PDF417_TRACE_H */
|
File diff suppressed because it is too large
Load Diff
@ -4417,7 +4417,7 @@ static void test_qr_perf(const testCtx *const p_ctx) {
|
|||||||
struct item data[] = {
|
struct item data[] = {
|
||||||
/* 0*/ { BARCODE_QRCODE, UNICODE_MODE, -1, -1,
|
/* 0*/ { BARCODE_QRCODE, UNICODE_MODE, -1, -1,
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点",
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点",
|
||||||
0, 37, 37, "107 chars, Mixed modes" },
|
ZINT_WARN_NONCOMPLIANT, 37, 37, "107 chars, Mixed modes" },
|
||||||
/* 1*/ { BARCODE_QRCODE, UNICODE_MODE, -1, -1,
|
/* 1*/ { BARCODE_QRCODE, UNICODE_MODE, -1, -1,
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点"
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点"
|
||||||
@ -4428,7 +4428,7 @@ static void test_qr_perf(const testCtx *const p_ctx) {
|
|||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点"
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点"
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点",
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 12345678901234567890123456 点点点点点点点点点点点点点点点点点点点点点点点点点点",
|
||||||
0, 105, 105, "963 chars, Mixed modes" },
|
ZINT_WARN_NONCOMPLIANT, 105, 105, "963 chars, Mixed modes" },
|
||||||
};
|
};
|
||||||
int data_size = ARRAY_SIZE(data);
|
int data_size = ARRAY_SIZE(data);
|
||||||
int i, length, ret;
|
int i, length, ret;
|
||||||
|
@ -3342,7 +3342,7 @@ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *sym
|
|||||||
{ "DataBarExpanded", BARCODE_DBAR_EXPSTK, 81, },
|
{ "DataBarExpanded", BARCODE_DBAR_EXPSTK, 81, },
|
||||||
{ "", BARCODE_PLANET, 82, },
|
{ "", BARCODE_PLANET, 82, },
|
||||||
{ "", -1, 83, },
|
{ "", -1, 83, },
|
||||||
{ "", BARCODE_MICROPDF417, 84, },
|
{ "MicroPDF417", BARCODE_MICROPDF417, 84, },
|
||||||
{ "", BARCODE_USPS_IMAIL, 85, },
|
{ "", BARCODE_USPS_IMAIL, 85, },
|
||||||
{ "", BARCODE_PLESSEY, 86, },
|
{ "", BARCODE_PLESSEY, 86, },
|
||||||
{ "", BARCODE_TELEPEN_NUM, 87, },
|
{ "", BARCODE_TELEPEN_NUM, 87, },
|
||||||
@ -3468,9 +3468,9 @@ int testUtilCanZXingCPP(int index, const struct zint_symbol *symbol, const char
|
|||||||
|
|
||||||
int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, const int length, char *bits,
|
int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source, const int length, char *bits,
|
||||||
char *buffer, const int buffer_size, int *p_cmp_len) {
|
char *buffer, const int buffer_size, int *p_cmp_len) {
|
||||||
static const char cmd_fmt[] = "zxingcppdecoder -width %d -textonly -format %s -bits '%s'";
|
static const char cmd_fmt[] = "zxingcppdecoder -textonly -format %s -width %d -bits '%s'";
|
||||||
static const char hint_cmd_fmt[] = "zxingcppdecoder -width %d -textonly -format %s -hint '%s' -bits '%s'";
|
static const char hint_cmd_fmt[] = "zxingcppdecoder -textonly -format %s -hint '%s' -width %d -bits '%s'";
|
||||||
static const char cs_cmd_fmt[] = "zxingcppdecoder -width %d -textonly -format %s -bits '%s' -charset %s";
|
static const char cs_cmd_fmt[] = "zxingcppdecoder -textonly -format %s -charset %s -width %d -bits '%s'";
|
||||||
|
|
||||||
const int bits_len = (int) strlen(bits);
|
const int bits_len = (int) strlen(bits);
|
||||||
const int width = symbol->width;
|
const int width = symbol->width;
|
||||||
@ -3519,11 +3519,11 @@ int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source,
|
|||||||
} else {
|
} else {
|
||||||
charset = "ISO8859_1";
|
charset = "ISO8859_1";
|
||||||
}
|
}
|
||||||
sprintf(cmd, cs_cmd_fmt, width, zxingcpp_barcode, bits, charset);
|
sprintf(cmd, cs_cmd_fmt, zxingcpp_barcode, charset, width, bits);
|
||||||
} else if (hint) {
|
} else if (hint) {
|
||||||
sprintf(cmd, hint_cmd_fmt, width, zxingcpp_barcode, hint, bits);
|
sprintf(cmd, hint_cmd_fmt, zxingcpp_barcode, hint, width, bits);
|
||||||
} else {
|
} else {
|
||||||
sprintf(cmd, cmd_fmt, width, zxingcpp_barcode, bits);
|
sprintf(cmd, cmd_fmt, zxingcpp_barcode, width, bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (symbol->debug & ZINT_DEBUG_TEST_PRINT) {
|
if (symbol->debug & ZINT_DEBUG_TEST_PRINT) {
|
||||||
|
Binary file not shown.
@ -293,7 +293,7 @@ extern "C" {
|
|||||||
#define GS1NOCHECK_MODE 0x0020 /* Do not check validity of GS1 data (except that printable ASCII only) */
|
#define GS1NOCHECK_MODE 0x0020 /* Do not check validity of GS1 data (except that printable ASCII only) */
|
||||||
#define HEIGHTPERROW_MODE 0x0040 /* Interpret `height` as per-row rather than as overall height */
|
#define HEIGHTPERROW_MODE 0x0040 /* Interpret `height` as per-row rather than as overall height */
|
||||||
#define FAST_MODE 0x0080 /* Use faster if less optimal encodation for symbologies that support it */
|
#define FAST_MODE 0x0080 /* Use faster if less optimal encodation for symbologies that support it */
|
||||||
/* Note: only DATAMATRIX currently */
|
/* Note: only DATAMATRIX, MICROPDF417 & PDF417 currently */
|
||||||
|
|
||||||
/* Data Matrix specific options (`symbol->option_3`) */
|
/* Data Matrix specific options (`symbol->option_3`) */
|
||||||
#define DM_SQUARE 100 /* Only consider square versions on automatic symbol size selection */
|
#define DM_SQUARE 100 /* Only consider square versions on automatic symbol size selection */
|
||||||
|
@ -56,6 +56,7 @@ HEADERS += ../backend/aztec.h \
|
|||||||
../backend/pcx.h \
|
../backend/pcx.h \
|
||||||
../backend/pdf417.h \
|
../backend/pdf417.h \
|
||||||
../backend/pdf417_tabs.h \
|
../backend/pdf417_tabs.h \
|
||||||
|
../backend/pdf417_trace.h \
|
||||||
../backend/qr.h \
|
../backend/qr.h \
|
||||||
../backend/reedsol.h \
|
../backend/reedsol.h \
|
||||||
../backend/reedsol_logs.h \
|
../backend/reedsol_logs.h \
|
||||||
|
@ -43,6 +43,7 @@ HEADERS += ../backend/aztec.h \
|
|||||||
../backend/pcx.h \
|
../backend/pcx.h \
|
||||||
../backend/pdf417.h \
|
../backend/pdf417.h \
|
||||||
../backend/pdf417_tabs.h \
|
../backend/pdf417_tabs.h \
|
||||||
|
../backend/pdf417_trace.h \
|
||||||
../backend/qr.h \
|
../backend/qr.h \
|
||||||
../backend/reedsol.h \
|
../backend/reedsol.h \
|
||||||
../backend/rss.h \
|
../backend/rss.h \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
% Zint Barcode Generator and Zint Barcode Studio User Manual
|
% Zint Barcode Generator and Zint Barcode Studio User Manual
|
||||||
% Version 2.11.1.9
|
% Version 2.11.1.9
|
||||||
% October 2022
|
% November 2022
|
||||||
|
|
||||||
# 1. Introduction
|
# 1. Introduction
|
||||||
|
|
||||||
@ -2031,7 +2031,8 @@ Value Effect
|
|||||||
overall height.
|
overall height.
|
||||||
|
|
||||||
`FAST_MODE` Use faster if less optimal encodation for symbologies that
|
`FAST_MODE` Use faster if less optimal encodation for symbologies that
|
||||||
support it (currently `DATAMATRIX` only).
|
support it (currently `DATAMATRIX`, `MICROPDF417` and
|
||||||
|
`PDF417` only).
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Table: API `input_mode` Values {#tbl:api_input_mode tag="$ $"}
|
Table: API `input_mode` Values {#tbl:api_input_mode tag="$ $"}
|
||||||
@ -2917,6 +2918,9 @@ This symbology uses Latin-1 character encoding by default but also supports the
|
|||||||
ECI encoding mechanism. A separate symbology ID (`BARCODE_HIBC_PDF`) can be used
|
ECI encoding mechanism. A separate symbology ID (`BARCODE_HIBC_PDF`) can be used
|
||||||
to encode Health Industry Barcode (HIBC) data.
|
to encode Health Industry Barcode (HIBC) data.
|
||||||
|
|
||||||
|
For a faster but less optimal encoding, the `--fast` option (API `input_mode |=
|
||||||
|
FAST_MODE`) may be used.
|
||||||
|
|
||||||
PDF417 supports Structured Append of up to 99,999 symbols and an optional
|
PDF417 supports Structured Append of up to 99,999 symbols and an optional
|
||||||
numeric ID of up to 30 digits, which can be set by using the `--structapp`
|
numeric ID of up to 30 digits, which can be set by using the `--structapp`
|
||||||
option (see [4.16 Structured Append]) (API `structapp`). The ID consists of up
|
option (see [4.16 Structured Append]) (API `structapp`). The ID consists of up
|
||||||
@ -2947,7 +2951,7 @@ can be determined using the `--cols` switch (API `option_2`) as with PDF417.
|
|||||||
This symbology uses Latin-1 character encoding by default but also supports the
|
This symbology uses Latin-1 character encoding by default but also supports the
|
||||||
ECI encoding mechanism. A separate symbology ID (`BARCODE_HIBC_MICPDF`) can be
|
ECI encoding mechanism. A separate symbology ID (`BARCODE_HIBC_MICPDF`) can be
|
||||||
used to encode Health Industry Barcode (HIBC) data. MicroPDF417 supports
|
used to encode Health Industry Barcode (HIBC) data. MicroPDF417 supports
|
||||||
Structured Append the same as PDF417, for which see details.
|
`FAST_MODE` and Structured Append the same as PDF417, for which see details.
|
||||||
|
|
||||||
### 6.2.7 GS1 DataBar Stacked (ISO 24724)
|
### 6.2.7 GS1 DataBar Stacked (ISO 24724)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Zint Barcode Generator and Zint Barcode Studio User Manual
|
Zint Barcode Generator and Zint Barcode Studio User Manual
|
||||||
Version 2.11.1.9
|
Version 2.11.1.9
|
||||||
October 2022
|
November 2022
|
||||||
|
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* For reference the following is a text-only version of the Zint manual, *
|
* For reference the following is a text-only version of the Zint manual, *
|
||||||
@ -2051,7 +2051,8 @@ property. Valid values are shown in the table below.
|
|||||||
overall height.
|
overall height.
|
||||||
|
|
||||||
FAST_MODE Use faster if less optimal encodation for symbologies that
|
FAST_MODE Use faster if less optimal encodation for symbologies that
|
||||||
support it (currently DATAMATRIX only).
|
support it (currently DATAMATRIX, MICROPDF417 and PDF417
|
||||||
|
only).
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
: Table : API input_mode Values
|
: Table : API input_mode Values
|
||||||
@ -2870,6 +2871,9 @@ This symbology uses Latin-1 character encoding by default but also supports the
|
|||||||
ECI encoding mechanism. A separate symbology ID (BARCODE_HIBC_PDF) can be used
|
ECI encoding mechanism. A separate symbology ID (BARCODE_HIBC_PDF) can be used
|
||||||
to encode Health Industry Barcode (HIBC) data.
|
to encode Health Industry Barcode (HIBC) data.
|
||||||
|
|
||||||
|
For a faster but less optimal encoding, the --fast option (API
|
||||||
|
input_mode |= FAST_MODE) may be used.
|
||||||
|
|
||||||
PDF417 supports Structured Append of up to 99,999 symbols and an optional
|
PDF417 supports Structured Append of up to 99,999 symbols and an optional
|
||||||
numeric ID of up to 30 digits, which can be set by using the --structapp option
|
numeric ID of up to 30 digits, which can be set by using the --structapp option
|
||||||
(see 4.16 Structured Append) (API structapp). The ID consists of up to 10
|
(see 4.16 Structured Append) (API structapp). The ID consists of up to 10
|
||||||
@ -2900,7 +2904,7 @@ can be determined using the --cols switch (API option_2) as with PDF417.
|
|||||||
This symbology uses Latin-1 character encoding by default but also supports the
|
This symbology uses Latin-1 character encoding by default but also supports the
|
||||||
ECI encoding mechanism. A separate symbology ID (BARCODE_HIBC_MICPDF) can be
|
ECI encoding mechanism. A separate symbology ID (BARCODE_HIBC_MICPDF) can be
|
||||||
used to encode Health Industry Barcode (HIBC) data. MicroPDF417 supports
|
used to encode Health Industry Barcode (HIBC) data. MicroPDF417 supports
|
||||||
Structured Append the same as PDF417, for which see details.
|
FAST_MODE and Structured Append the same as PDF417, for which see details.
|
||||||
|
|
||||||
6.2.7 GS1 DataBar Stacked (ISO 24724)
|
6.2.7 GS1 DataBar Stacked (ISO 24724)
|
||||||
|
|
||||||
@ -4121,7 +4125,7 @@ defined.
|
|||||||
|
|
||||||
Annex B. Man Page ZINT(1)
|
Annex B. Man Page ZINT(1)
|
||||||
|
|
||||||
% ZINT(1) Version 2.11.1.9 % % October 2022
|
% ZINT(1) Version 2.11.1.9 % % November 2022
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
|
|
||||||
@ -4284,7 +4288,8 @@ OPTIONS
|
|||||||
|
|
||||||
--fast
|
--fast
|
||||||
|
|
||||||
Use faster if less optimal encodation (currently affects Data Matrix only).
|
Use faster if less optimal encodation (currently affects Data Matrix,
|
||||||
|
MicroPDF417 & PDF417 only).
|
||||||
|
|
||||||
--fg=COLOUR
|
--fg=COLOUR
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
. ftr VB CB
|
. ftr VB CB
|
||||||
. ftr VBI CBI
|
. ftr VBI CBI
|
||||||
.\}
|
.\}
|
||||||
.TH "ZINT" "1" "October 2022" "Version 2.11.1.9" ""
|
.TH "ZINT" "1" "November 2022" "Version 2.11.1.9" ""
|
||||||
.hy
|
.hy
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.PP
|
.PP
|
||||||
@ -193,8 +193,8 @@ The escape sequences are:
|
|||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
\f[V]--fast\f[R]
|
\f[V]--fast\f[R]
|
||||||
Use faster if less optimal encodation (currently affects Data Matrix
|
Use faster if less optimal encodation (currently affects Data Matrix,
|
||||||
only).
|
MicroPDF417 & PDF417 only).
|
||||||
.TP
|
.TP
|
||||||
\f[V]--fg=COLOUR\f[R]
|
\f[V]--fg=COLOUR\f[R]
|
||||||
Specify a foreground (ink) colour where \f[I]COLOUR\f[R] is in hex
|
Specify a foreground (ink) colour where \f[I]COLOUR\f[R] is in hex
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
% ZINT(1) Version 2.11.1.9
|
% ZINT(1) Version 2.11.1.9
|
||||||
%
|
%
|
||||||
% October 2022
|
% November 2022
|
||||||
|
|
||||||
# NAME
|
# NAME
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`S
|
|||||||
|
|
||||||
`--fast`
|
`--fast`
|
||||||
|
|
||||||
: Use faster if less optimal encodation (currently affects Data Matrix only).
|
: Use faster if less optimal encodation (currently affects Data Matrix, MicroPDF417 & PDF417 only).
|
||||||
|
|
||||||
`--fg=COLOUR`
|
`--fg=COLOUR`
|
||||||
|
|
||||||
|
@ -231,6 +231,20 @@ the data with a slash "/"</string>
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chkMPDFFast">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Fast encoding</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Use a faster but less optimal algorithm
|
||||||
|
for encoding the data</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBoxMPDFStructApp">
|
<widget class="QGroupBox" name="groupBoxMPDFStructApp">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -922,6 +922,20 @@ right row indicators and shortens the stop pattern</string>
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chkPDFFast">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Fast encoding</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Use a faster but less optimal algorithm
|
||||||
|
for encoding the data</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBoxPDFStructApp">
|
<widget class="QGroupBox" name="groupBoxPDFStructApp">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -1486,6 +1486,7 @@ void MainWindow::change_options()
|
|||||||
connect(get_widget(QSL("radPDFTruncated")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
connect(get_widget(QSL("radPDFTruncated")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||||
connect(get_widget(QSL("radPDFStand")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
connect(get_widget(QSL("radPDFStand")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||||
connect(get_widget(QSL("radPDFHIBC")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
connect(get_widget(QSL("radPDFHIBC")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||||
|
connect(get_widget(QSL("chkPDFFast")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||||
connect(get_widget(QSL("spnPDFStructAppCount")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
connect(get_widget(QSL("spnPDFStructAppCount")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
||||||
connect(get_widget(QSL("spnPDFStructAppCount")), SIGNAL(valueChanged( int )), SLOT(structapp_ui_set()));
|
connect(get_widget(QSL("spnPDFStructAppCount")), SIGNAL(valueChanged( int )), SLOT(structapp_ui_set()));
|
||||||
connect(get_widget(QSL("spnPDFStructAppIndex")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
connect(get_widget(QSL("spnPDFStructAppIndex")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
||||||
@ -1510,6 +1511,7 @@ void MainWindow::change_options()
|
|||||||
connect(m_btnHeightPerRowDisable, SIGNAL(clicked( bool )), SLOT(height_per_row_disable()));
|
connect(m_btnHeightPerRowDisable, SIGNAL(clicked( bool )), SLOT(height_per_row_disable()));
|
||||||
connect(m_btnHeightPerRowDefault, SIGNAL(clicked( bool )), SLOT(height_per_row_default()));
|
connect(m_btnHeightPerRowDefault, SIGNAL(clicked( bool )), SLOT(height_per_row_default()));
|
||||||
connect(get_widget(QSL("radMPDFStand")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
connect(get_widget(QSL("radMPDFStand")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||||
|
connect(get_widget(QSL("chkMPDFFast")), SIGNAL(toggled( bool )), SLOT(update_preview()));
|
||||||
connect(get_widget(QSL("spnMPDFStructAppCount")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
connect(get_widget(QSL("spnMPDFStructAppCount")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
||||||
connect(get_widget(QSL("spnMPDFStructAppCount")), SIGNAL(valueChanged( int )), SLOT(structapp_ui_set()));
|
connect(get_widget(QSL("spnMPDFStructAppCount")), SIGNAL(valueChanged( int )), SLOT(structapp_ui_set()));
|
||||||
connect(get_widget(QSL("spnMPDFStructAppIndex")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
connect(get_widget(QSL("spnMPDFStructAppIndex")), SIGNAL(valueChanged( int )), SLOT(update_preview()));
|
||||||
@ -2437,6 +2439,10 @@ void MainWindow::update_preview()
|
|||||||
}
|
}
|
||||||
m_bc.bc.setOption1(get_cmb_index(QSL("cmbPDFECC")) - 1);
|
m_bc.bc.setOption1(get_cmb_index(QSL("cmbPDFECC")) - 1);
|
||||||
|
|
||||||
|
if (get_chk_val(QSL("chkPDFFast"))) {
|
||||||
|
m_bc.bc.setInputMode(FAST_MODE | m_bc.bc.inputMode());
|
||||||
|
}
|
||||||
|
|
||||||
if ((item_val = get_spn_val(QSL("spnPDFStructAppCount"))) > 1) {
|
if ((item_val = get_spn_val(QSL("spnPDFStructAppCount"))) > 1) {
|
||||||
m_bc.bc.setStructApp(item_val, get_spn_val(QSL("spnPDFStructAppIndex")),
|
m_bc.bc.setStructApp(item_val, get_spn_val(QSL("spnPDFStructAppIndex")),
|
||||||
get_txt_val(QSL("txtPDFStructAppID")));
|
get_txt_val(QSL("txtPDFStructAppID")));
|
||||||
@ -2451,6 +2457,10 @@ void MainWindow::update_preview()
|
|||||||
|
|
||||||
m_bc.bc.setOption2(get_cmb_index(QSL("cmbMPDFCols")));
|
m_bc.bc.setOption2(get_cmb_index(QSL("cmbMPDFCols")));
|
||||||
|
|
||||||
|
if (get_chk_val(QSL("chkMPDFFast"))) {
|
||||||
|
m_bc.bc.setInputMode(FAST_MODE | m_bc.bc.inputMode());
|
||||||
|
}
|
||||||
|
|
||||||
if ((item_val = get_spn_val(QSL("spnMPDFStructAppCount"))) > 1) {
|
if ((item_val = get_spn_val(QSL("spnMPDFStructAppCount"))) > 1) {
|
||||||
m_bc.bc.setStructApp(item_val, get_spn_val(QSL("spnMPDFStructAppIndex")),
|
m_bc.bc.setStructApp(item_val, get_spn_val(QSL("spnMPDFStructAppIndex")),
|
||||||
get_txt_val(QSL("txtMPDFStructAppID")));
|
get_txt_val(QSL("txtMPDFStructAppID")));
|
||||||
@ -3677,6 +3687,7 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
|
|||||||
settings.setValue(QSL("studio/bc/pdf417/ecc"), get_cmb_index(QSL("cmbPDFECC")));
|
settings.setValue(QSL("studio/bc/pdf417/ecc"), get_cmb_index(QSL("cmbPDFECC")));
|
||||||
settings.setValue(QSL("studio/bc/pdf417/encoding_mode"), get_rad_grp_index(
|
settings.setValue(QSL("studio/bc/pdf417/encoding_mode"), get_rad_grp_index(
|
||||||
QStringList() << QSL("radPDFStand") << QSL("radPDFTruncated") << QSL("radPDFHIBC")));
|
QStringList() << QSL("radPDFStand") << QSL("radPDFTruncated") << QSL("radPDFHIBC")));
|
||||||
|
settings.setValue(QSL("studio/bc/pdf417/chk_fast"), get_chk_val(QSL("chkPDFFast")));
|
||||||
settings.setValue(QSL("studio/bc/pdf417/structapp_count"), get_spn_val(QSL("spnPDFStructAppCount")));
|
settings.setValue(QSL("studio/bc/pdf417/structapp_count"), get_spn_val(QSL("spnPDFStructAppCount")));
|
||||||
settings.setValue(QSL("studio/bc/pdf417/structapp_index"), get_spn_val(QSL("spnPDFStructAppIndex")));
|
settings.setValue(QSL("studio/bc/pdf417/structapp_index"), get_spn_val(QSL("spnPDFStructAppIndex")));
|
||||||
settings.setValue(QSL("studio/bc/pdf417/structapp_id"), get_txt_val(QSL("txtPDFStructAppID")));
|
settings.setValue(QSL("studio/bc/pdf417/structapp_id"), get_txt_val(QSL("txtPDFStructAppID")));
|
||||||
@ -3688,6 +3699,7 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
|
|||||||
settings.setValue(QSL("studio/bc/micropdf417/height_per_row"), get_dspn_val(QSL("spnMPDFHeightPerRow")));
|
settings.setValue(QSL("studio/bc/micropdf417/height_per_row"), get_dspn_val(QSL("spnMPDFHeightPerRow")));
|
||||||
settings.setValue(QSL("studio/bc/micropdf417/encoding_mode"), get_rad_grp_index(
|
settings.setValue(QSL("studio/bc/micropdf417/encoding_mode"), get_rad_grp_index(
|
||||||
QStringList() << QSL("radMPDFStand") << QSL("radMPDFHIBC")));
|
QStringList() << QSL("radMPDFStand") << QSL("radMPDFHIBC")));
|
||||||
|
settings.setValue(QSL("studio/bc/micropdf417/chk_fast"), get_chk_val(QSL("chkMPDFFast")));
|
||||||
settings.setValue(QSL("studio/bc/micropdf417/structapp_count"),
|
settings.setValue(QSL("studio/bc/micropdf417/structapp_count"),
|
||||||
get_spn_val(QSL("spnMPDFStructAppCount")));
|
get_spn_val(QSL("spnMPDFStructAppCount")));
|
||||||
settings.setValue(QSL("studio/bc/micropdf417/structapp_index"),
|
settings.setValue(QSL("studio/bc/micropdf417/structapp_index"),
|
||||||
@ -4059,6 +4071,7 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
|
|||||||
set_cmb_from_setting(settings, QSL("studio/bc/pdf417/ecc"), QSL("cmbPDFECC"));
|
set_cmb_from_setting(settings, QSL("studio/bc/pdf417/ecc"), QSL("cmbPDFECC"));
|
||||||
set_rad_from_setting(settings, QSL("studio/bc/pdf417/encoding_mode"),
|
set_rad_from_setting(settings, QSL("studio/bc/pdf417/encoding_mode"),
|
||||||
QStringList() << QSL("radPDFStand") << QSL("radPDFTruncated") << QSL("radPDFHIBC"));
|
QStringList() << QSL("radPDFStand") << QSL("radPDFTruncated") << QSL("radPDFHIBC"));
|
||||||
|
set_chk_from_setting(settings, QSL("studio/bc/pdf417/chk_fast"), QSL("chkPDFFast"));
|
||||||
set_spn_from_setting(settings, QSL("studio/bc/pdf417/structapp_count"), QSL("spnPDFStructAppCount"), 1);
|
set_spn_from_setting(settings, QSL("studio/bc/pdf417/structapp_count"), QSL("spnPDFStructAppCount"), 1);
|
||||||
set_spn_from_setting(settings, QSL("studio/bc/pdf417/structapp_index"), QSL("spnPDFStructAppIndex"), 0);
|
set_spn_from_setting(settings, QSL("studio/bc/pdf417/structapp_index"), QSL("spnPDFStructAppIndex"), 0);
|
||||||
set_txt_from_setting(settings, QSL("studio/bc/pdf417/structapp_id"), QSL("txtPDFStructAppID"), QSL(""));
|
set_txt_from_setting(settings, QSL("studio/bc/pdf417/structapp_id"), QSL("txtPDFStructAppID"), QSL(""));
|
||||||
@ -4071,6 +4084,7 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
|
|||||||
0.0f);
|
0.0f);
|
||||||
set_rad_from_setting(settings, QSL("studio/bc/micropdf417/encoding_mode"),
|
set_rad_from_setting(settings, QSL("studio/bc/micropdf417/encoding_mode"),
|
||||||
QStringList() << QSL("radMPDFStand") << QSL("radMPDFHIBC"));
|
QStringList() << QSL("radMPDFStand") << QSL("radMPDFHIBC"));
|
||||||
|
set_chk_from_setting(settings, QSL("studio/bc/micropdf417/chk_fast"), QSL("chkMPDFFast"));
|
||||||
set_spn_from_setting(settings, QSL("studio/bc/micropdf417/structapp_count"),
|
set_spn_from_setting(settings, QSL("studio/bc/micropdf417/structapp_count"),
|
||||||
QSL("spnMPDFStructAppCount"), 1);
|
QSL("spnMPDFStructAppCount"), 1);
|
||||||
set_spn_from_setting(settings, QSL("studio/bc/micropdf417/structapp_index"),
|
set_spn_from_setting(settings, QSL("studio/bc/micropdf417/structapp_index"),
|
||||||
|
@ -201,6 +201,7 @@
|
|||||||
<ClInclude Include="..\backend\pcx.h" />
|
<ClInclude Include="..\backend\pcx.h" />
|
||||||
<ClInclude Include="..\backend\pdf417.h" />
|
<ClInclude Include="..\backend\pdf417.h" />
|
||||||
<ClInclude Include="..\backend\pdf417_tabs.h" />
|
<ClInclude Include="..\backend\pdf417_tabs.h" />
|
||||||
|
<ClInclude Include="..\backend\pdf417_trace.h" />
|
||||||
<ClInclude Include="..\backend\qr.h" />
|
<ClInclude Include="..\backend\qr.h" />
|
||||||
<ClInclude Include="..\backend\reedsol.h" />
|
<ClInclude Include="..\backend\reedsol.h" />
|
||||||
<ClInclude Include="..\backend\reedsol_logs.h" />
|
<ClInclude Include="..\backend\reedsol_logs.h" />
|
||||||
|
@ -589,6 +589,10 @@
|
|||||||
RelativePath="..\..\backend\pdf417_tabs.h"
|
RelativePath="..\..\backend\pdf417_tabs.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\backend\pdf417_trace.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\backend\qr.h"
|
RelativePath="..\..\backend\qr.h"
|
||||||
>
|
>
|
||||||
|
@ -378,6 +378,7 @@
|
|||||||
<ClInclude Include="..\..\backend\pcx.h" />
|
<ClInclude Include="..\..\backend\pcx.h" />
|
||||||
<ClInclude Include="..\..\backend\pdf417.h" />
|
<ClInclude Include="..\..\backend\pdf417.h" />
|
||||||
<ClInclude Include="..\..\backend\pdf417_tabs.h" />
|
<ClInclude Include="..\..\backend\pdf417_tabs.h" />
|
||||||
|
<ClInclude Include="..\..\backend\pdf417_trace.h" />
|
||||||
<ClInclude Include="..\..\backend\qr.h" />
|
<ClInclude Include="..\..\backend\qr.h" />
|
||||||
<ClInclude Include="..\..\backend\reedsol.h" />
|
<ClInclude Include="..\..\backend\reedsol.h" />
|
||||||
<ClInclude Include="..\..\backend\reedsol_logs.h" />
|
<ClInclude Include="..\..\backend\reedsol_logs.h" />
|
||||||
|
@ -149,6 +149,7 @@
|
|||||||
<ClInclude Include="..\..\backend\pcx.h" />
|
<ClInclude Include="..\..\backend\pcx.h" />
|
||||||
<ClInclude Include="..\..\backend\pdf417.h" />
|
<ClInclude Include="..\..\backend\pdf417.h" />
|
||||||
<ClInclude Include="..\..\backend\pdf417_tabs.h" />
|
<ClInclude Include="..\..\backend\pdf417_tabs.h" />
|
||||||
|
<ClInclude Include="..\..\backend\pdf417_trace.h" />
|
||||||
<ClInclude Include="..\..\backend\qr.h" />
|
<ClInclude Include="..\..\backend\qr.h" />
|
||||||
<ClInclude Include="..\..\backend\reedsol.h" />
|
<ClInclude Include="..\..\backend\reedsol.h" />
|
||||||
<ClInclude Include="..\..\backend\reedsol_logs.h" />
|
<ClInclude Include="..\..\backend\reedsol_logs.h" />
|
||||||
|
@ -201,6 +201,7 @@
|
|||||||
<ClInclude Include="..\..\backend\pcx.h" />
|
<ClInclude Include="..\..\backend\pcx.h" />
|
||||||
<ClInclude Include="..\..\backend\pdf417.h" />
|
<ClInclude Include="..\..\backend\pdf417.h" />
|
||||||
<ClInclude Include="..\..\backend\pdf417_tabs.h" />
|
<ClInclude Include="..\..\backend\pdf417_tabs.h" />
|
||||||
|
<ClInclude Include="..\..\backend\pdf417_trace.h" />
|
||||||
<ClInclude Include="..\..\backend\qr.h" />
|
<ClInclude Include="..\..\backend\qr.h" />
|
||||||
<ClInclude Include="..\..\backend\reedsol.h" />
|
<ClInclude Include="..\..\backend\reedsol.h" />
|
||||||
<ClInclude Include="..\..\backend\reedsol_logs.h" />
|
<ClInclude Include="..\..\backend\reedsol_logs.h" />
|
||||||
|
Loading…
Reference in New Issue
Block a user