Add output_options BARCODE_QUIET_ZONES and BARCODE_NO_QUIET_ZONES

This commit is contained in:
gitlost 2021-09-24 13:21:24 +01:00
parent da80d44196
commit 4284f3c578
32 changed files with 1334 additions and 99 deletions

View file

@ -175,7 +175,9 @@ INTERNAL int png_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf)
}
/* For Ultracode, have background only if have whitespace/quiet zones */
if (symbol->whitespace_width > 0 || symbol->whitespace_height > 0) { /* TODO: BARCODE_QUIET_ZONES also */
if (symbol->whitespace_width > 0 || symbol->whitespace_height > 0
|| ((symbol->output_options & BARCODE_QUIET_ZONES)
&& !(symbol->output_options & BARCODE_NO_QUIET_ZONES))) {
/* Check whether can re-use white */
if (bg.red == 0xff && bg.green == 0xff && bg.blue == 0xff && bg_alpha == fg_alpha) {
map['0'] = 0; /* Re-use white */