DATAMATRIX: new algorithm for (near-)minimal encoding, props Alex Geller

Add FAST_MODE input_mode flag and --fast CLI/Tcl option that selects older
  faster ISO algorithm (may be used by other symbologies in the future)
  and "Fast Encoding" checkbox to Data Matrix GUI
GUI: adds Zint version numbers to DATAMATRIX sizes.
This commit is contained in:
gitlost 2021-12-18 16:22:02 +00:00
parent caadc87f7e
commit b36fba8ba6
28 changed files with 4578 additions and 2298 deletions

View file

@ -44,6 +44,9 @@ Changes
- GUI: add CLI equivalent dialog (#163)
- Add ZBarcode_BarcodeName()
- GUI: data dialog: convert Line Feeds if escaping on input, escape on output
- DATAMATRIX: new algorithm for (near-)optimal encoding, props Alex Geller
- CLI/GUI/Tcl: add --fast option to select faster but less optimal DATAMATRIX
algorithm (previous default)
Bugs
----

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
/*
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
modification, are permitted provided that the following conditions
@ -32,7 +32,7 @@
/* vim: set ts=4 sw=4 et : */
/*
Containes Extended Rectangular Data Matrix (DMRE)
Contains Extended Rectangular Data Matrix (DMRE)
See http://www.dmre.info for information
Contact: harald.oehlmann@eurodatacouncil.org
*/

View file

@ -49,7 +49,6 @@
#ifndef _MSC_VER
#include <stdint.h>
#else
#include <malloc.h>
#include "ms_stdint.h"
#endif
#include <assert.h>

View file

@ -22,126 +22,147 @@
<circle cx="39.00" cy="5.00" r="0.80" />
<circle cx="3.00" cy="7.00" r="0.80" />
<circle cx="7.00" cy="7.00" r="0.80" />
<circle cx="13.00" cy="7.00" r="0.80" />
<circle cx="9.00" cy="7.00" r="0.80" />
<circle cx="11.00" cy="7.00" r="0.80" />
<circle cx="15.00" cy="7.00" r="0.80" />
<circle cx="19.00" cy="7.00" r="0.80" />
<circle cx="21.00" cy="7.00" r="0.80" />
<circle cx="25.00" cy="7.00" r="0.80" />
<circle cx="29.00" cy="7.00" r="0.80" />
<circle cx="35.00" cy="7.00" r="0.80" />
<circle cx="37.00" cy="7.00" r="0.80" />
<circle cx="27.00" cy="7.00" r="0.80" />
<circle cx="31.00" cy="7.00" r="0.80" />
<circle cx="39.00" cy="7.00" r="0.80" />
<circle cx="41.00" cy="7.00" r="0.80" />
<circle cx="3.00" cy="9.00" r="0.80" />
<circle cx="7.00" cy="9.00" r="0.80" />
<circle cx="9.00" cy="9.00" r="0.80" />
<circle cx="11.00" cy="9.00" r="0.80" />
<circle cx="15.00" cy="9.00" r="0.80" />
<circle cx="19.00" cy="9.00" r="0.80" />
<circle cx="23.00" cy="9.00" r="0.80" />
<circle cx="17.00" cy="9.00" r="0.80" />
<circle cx="21.00" cy="9.00" r="0.80" />
<circle cx="27.00" cy="9.00" r="0.80" />
<circle cx="29.00" cy="9.00" r="0.80" />
<circle cx="33.00" cy="9.00" r="0.80" />
<circle cx="35.00" cy="9.00" r="0.80" />
<circle cx="37.00" cy="9.00" r="0.80" />
<circle cx="3.00" cy="11.00" r="0.80" />
<circle cx="7.00" cy="11.00" r="0.80" />
<circle cx="9.00" cy="11.00" r="0.80" />
<circle cx="11.00" cy="11.00" r="0.80" />
<circle cx="13.00" cy="11.00" r="0.80" />
<circle cx="15.00" cy="11.00" r="0.80" />
<circle cx="17.00" cy="11.00" r="0.80" />
<circle cx="27.00" cy="11.00" r="0.80" />
<circle cx="21.00" cy="11.00" r="0.80" />
<circle cx="23.00" cy="11.00" r="0.80" />
<circle cx="25.00" cy="11.00" r="0.80" />
<circle cx="29.00" cy="11.00" r="0.80" />
<circle cx="31.00" cy="11.00" r="0.80" />
<circle cx="33.00" cy="11.00" r="0.80" />
<circle cx="37.00" cy="11.00" r="0.80" />
<circle cx="35.00" cy="11.00" r="0.80" />
<circle cx="39.00" cy="11.00" r="0.80" />
<circle cx="41.00" cy="11.00" r="0.80" />
<circle cx="3.00" cy="13.00" r="0.80" />
<circle cx="7.00" cy="13.00" r="0.80" />
<circle cx="11.00" cy="13.00" r="0.80" />
<circle cx="9.00" cy="13.00" r="0.80" />
<circle cx="13.00" cy="13.00" r="0.80" />
<circle cx="15.00" cy="13.00" r="0.80" />
<circle cx="17.00" cy="13.00" r="0.80" />
<circle cx="19.00" cy="13.00" r="0.80" />
<circle cx="21.00" cy="13.00" r="0.80" />
<circle cx="23.00" cy="13.00" r="0.80" />
<circle cx="29.00" cy="13.00" r="0.80" />
<circle cx="33.00" cy="13.00" r="0.80" />
<circle cx="35.00" cy="13.00" r="0.80" />
<circle cx="39.00" cy="13.00" r="0.80" />
<circle cx="3.00" cy="15.00" r="0.80" />
<circle cx="13.00" cy="15.00" r="0.80" />
<circle cx="7.00" cy="15.00" r="0.80" />
<circle cx="9.00" cy="15.00" r="0.80" />
<circle cx="11.00" cy="15.00" r="0.80" />
<circle cx="15.00" cy="15.00" r="0.80" />
<circle cx="19.00" cy="15.00" r="0.80" />
<circle cx="21.00" cy="15.00" r="0.80" />
<circle cx="25.00" cy="15.00" r="0.80" />
<circle cx="27.00" cy="15.00" r="0.80" />
<circle cx="29.00" cy="15.00" r="0.80" />
<circle cx="31.00" cy="15.00" r="0.80" />
<circle cx="35.00" cy="15.00" r="0.80" />
<circle cx="39.00" cy="15.00" r="0.80" />
<circle cx="41.00" cy="15.00" r="0.80" />
<circle cx="3.00" cy="17.00" r="0.80" />
<circle cx="5.00" cy="17.00" r="0.80" />
<circle cx="15.00" cy="17.00" r="0.80" />
<circle cx="11.00" cy="17.00" r="0.80" />
<circle cx="13.00" cy="17.00" r="0.80" />
<circle cx="17.00" cy="17.00" r="0.80" />
<circle cx="19.00" cy="17.00" r="0.80" />
<circle cx="21.00" cy="17.00" r="0.80" />
<circle cx="23.00" cy="17.00" r="0.80" />
<circle cx="25.00" cy="17.00" r="0.80" />
<circle cx="27.00" cy="17.00" r="0.80" />
<circle cx="29.00" cy="17.00" r="0.80" />
<circle cx="31.00" cy="17.00" r="0.80" />
<circle cx="33.00" cy="17.00" r="0.80" />
<circle cx="35.00" cy="17.00" r="0.80" />
<circle cx="37.00" cy="17.00" r="0.80" />
<circle cx="39.00" cy="17.00" r="0.80" />
<circle cx="3.00" cy="19.00" r="0.80" />
<circle cx="5.00" cy="19.00" r="0.80" />
<circle cx="7.00" cy="19.00" r="0.80" />
<circle cx="9.00" cy="19.00" r="0.80" />
<circle cx="13.00" cy="19.00" r="0.80" />
<circle cx="17.00" cy="19.00" r="0.80" />
<circle cx="19.00" cy="19.00" r="0.80" />
<circle cx="21.00" cy="19.00" r="0.80" />
<circle cx="23.00" cy="19.00" r="0.80" />
<circle cx="25.00" cy="19.00" r="0.80" />
<circle cx="27.00" cy="19.00" r="0.80" />
<circle cx="29.00" cy="19.00" r="0.80" />
<circle cx="31.00" cy="19.00" r="0.80" />
<circle cx="33.00" cy="19.00" r="0.80" />
<circle cx="37.00" cy="19.00" r="0.80" />
<circle cx="39.00" cy="19.00" r="0.80" />
<circle cx="41.00" cy="19.00" r="0.80" />
<circle cx="3.00" cy="21.00" r="0.80" />
<circle cx="5.00" cy="21.00" r="0.80" />
<circle cx="7.00" cy="21.00" r="0.80" />
<circle cx="9.00" cy="21.00" r="0.80" />
<circle cx="17.00" cy="21.00" r="0.80" />
<circle cx="19.00" cy="21.00" r="0.80" />
<circle cx="21.00" cy="21.00" r="0.80" />
<circle cx="27.00" cy="21.00" r="0.80" />
<circle cx="23.00" cy="21.00" r="0.80" />
<circle cx="25.00" cy="21.00" r="0.80" />
<circle cx="35.00" cy="21.00" r="0.80" />
<circle cx="37.00" cy="21.00" r="0.80" />
<circle cx="3.00" cy="23.00" r="0.80" />
<circle cx="5.00" cy="23.00" r="0.80" />
<circle cx="9.00" cy="23.00" r="0.80" />
<circle cx="11.00" cy="23.00" r="0.80" />
<circle cx="17.00" cy="23.00" r="0.80" />
<circle cx="19.00" cy="23.00" r="0.80" />
<circle cx="35.00" cy="23.00" r="0.80" />
<circle cx="21.00" cy="23.00" r="0.80" />
<circle cx="23.00" cy="23.00" r="0.80" />
<circle cx="29.00" cy="23.00" r="0.80" />
<circle cx="37.00" cy="23.00" r="0.80" />
<circle cx="41.00" cy="23.00" r="0.80" />
<circle cx="3.00" cy="25.00" r="0.80" />
<circle cx="5.00" cy="25.00" r="0.80" />
<circle cx="7.00" cy="25.00" r="0.80" />
<circle cx="9.00" cy="25.00" r="0.80" />
<circle cx="11.00" cy="25.00" r="0.80" />
<circle cx="13.00" cy="25.00" r="0.80" />
<circle cx="17.00" cy="25.00" r="0.80" />
<circle cx="21.00" cy="25.00" r="0.80" />
<circle cx="23.00" cy="25.00" r="0.80" />
<circle cx="25.00" cy="25.00" r="0.80" />
<circle cx="29.00" cy="25.00" r="0.80" />
<circle cx="27.00" cy="25.00" r="0.80" />
<circle cx="31.00" cy="25.00" r="0.80" />
<circle cx="35.00" cy="25.00" r="0.80" />
<circle cx="39.00" cy="25.00" r="0.80" />
<circle cx="3.00" cy="27.00" r="0.80" />
<circle cx="7.00" cy="27.00" r="0.80" />
<circle cx="9.00" cy="27.00" r="0.80" />
<circle cx="11.00" cy="27.00" r="0.80" />
<circle cx="13.00" cy="27.00" r="0.80" />
<circle cx="15.00" cy="27.00" r="0.80" />
<circle cx="19.00" cy="27.00" r="0.80" />
<circle cx="17.00" cy="27.00" r="0.80" />
<circle cx="21.00" cy="27.00" r="0.80" />
<circle cx="33.00" cy="27.00" r="0.80" />
<circle cx="39.00" cy="27.00" r="0.80" />
<circle cx="29.00" cy="27.00" r="0.80" />
<circle cx="37.00" cy="27.00" r="0.80" />
<circle cx="41.00" cy="27.00" r="0.80" />
<circle cx="3.00" cy="29.00" r="0.80" />
<circle cx="5.00" cy="29.00" r="0.80" />
<circle cx="7.00" cy="29.00" r="0.80" />
<circle cx="11.00" cy="29.00" r="0.80" />
<circle cx="13.00" cy="29.00" r="0.80" />
<circle cx="15.00" cy="29.00" r="0.80" />
<circle cx="17.00" cy="29.00" r="0.80" />
<circle cx="19.00" cy="29.00" r="0.80" />
<circle cx="27.00" cy="29.00" r="0.80" />
<circle cx="29.00" cy="29.00" r="0.80" />
<circle cx="33.00" cy="29.00" r="0.80" />
<circle cx="31.00" cy="29.00" r="0.80" />
<circle cx="3.00" cy="31.00" r="0.80" />
<circle cx="5.00" cy="31.00" r="0.80" />
<circle cx="13.00" cy="31.00" r="0.80" />
<circle cx="15.00" cy="31.00" r="0.80" />
<circle cx="17.00" cy="31.00" r="0.80" />
<circle cx="19.00" cy="31.00" r="0.80" />
<circle cx="25.00" cy="31.00" r="0.80" />
<circle cx="27.00" cy="31.00" r="0.80" />
<circle cx="37.00" cy="31.00" r="0.80" />
<circle cx="29.00" cy="31.00" r="0.80" />
<circle cx="31.00" cy="31.00" r="0.80" />
<circle cx="33.00" cy="31.00" r="0.80" />
<circle cx="35.00" cy="31.00" r="0.80" />
<circle cx="39.00" cy="31.00" r="0.80" />
<circle cx="41.00" cy="31.00" r="0.80" />
<circle cx="3.00" cy="33.00" r="0.80" />
@ -150,50 +171,61 @@
<circle cx="13.00" cy="33.00" r="0.80" />
<circle cx="17.00" cy="33.00" r="0.80" />
<circle cx="19.00" cy="33.00" r="0.80" />
<circle cx="27.00" cy="33.00" r="0.80" />
<circle cx="23.00" cy="33.00" r="0.80" />
<circle cx="25.00" cy="33.00" r="0.80" />
<circle cx="29.00" cy="33.00" r="0.80" />
<circle cx="31.00" cy="33.00" r="0.80" />
<circle cx="37.00" cy="33.00" r="0.80" />
<circle cx="39.00" cy="33.00" r="0.80" />
<circle cx="3.00" cy="35.00" r="0.80" />
<circle cx="5.00" cy="35.00" r="0.80" />
<circle cx="13.00" cy="35.00" r="0.80" />
<circle cx="15.00" cy="35.00" r="0.80" />
<circle cx="17.00" cy="35.00" r="0.80" />
<circle cx="19.00" cy="35.00" r="0.80" />
<circle cx="21.00" cy="35.00" r="0.80" />
<circle cx="23.00" cy="35.00" r="0.80" />
<circle cx="25.00" cy="35.00" r="0.80" />
<circle cx="27.00" cy="35.00" r="0.80" />
<circle cx="29.00" cy="35.00" r="0.80" />
<circle cx="37.00" cy="35.00" r="0.80" />
<circle cx="31.00" cy="35.00" r="0.80" />
<circle cx="33.00" cy="35.00" r="0.80" />
<circle cx="39.00" cy="35.00" r="0.80" />
<circle cx="41.00" cy="35.00" r="0.80" />
<circle cx="3.00" cy="37.00" r="0.80" />
<circle cx="5.00" cy="37.00" r="0.80" />
<circle cx="13.00" cy="37.00" r="0.80" />
<circle cx="17.00" cy="37.00" r="0.80" />
<circle cx="9.00" cy="37.00" r="0.80" />
<circle cx="11.00" cy="37.00" r="0.80" />
<circle cx="21.00" cy="37.00" r="0.80" />
<circle cx="23.00" cy="37.00" r="0.80" />
<circle cx="25.00" cy="37.00" r="0.80" />
<circle cx="27.00" cy="37.00" r="0.80" />
<circle cx="29.00" cy="37.00" r="0.80" />
<circle cx="31.00" cy="37.00" r="0.80" />
<circle cx="33.00" cy="37.00" r="0.80" />
<circle cx="35.00" cy="37.00" r="0.80" />
<circle cx="37.00" cy="37.00" r="0.80" />
<circle cx="3.00" cy="39.00" r="0.80" />
<circle cx="5.00" cy="39.00" r="0.80" />
<circle cx="7.00" cy="39.00" r="0.80" />
<circle cx="9.00" cy="39.00" r="0.80" />
<circle cx="11.00" cy="39.00" r="0.80" />
<circle cx="15.00" cy="39.00" r="0.80" />
<circle cx="21.00" cy="39.00" r="0.80" />
<circle cx="23.00" cy="39.00" r="0.80" />
<circle cx="25.00" cy="39.00" r="0.80" />
<circle cx="27.00" cy="39.00" r="0.80" />
<circle cx="29.00" cy="39.00" r="0.80" />
<circle cx="31.00" cy="39.00" r="0.80" />
<circle cx="33.00" cy="39.00" r="0.80" />
<circle cx="35.00" cy="39.00" r="0.80" />
<circle cx="37.00" cy="39.00" r="0.80" />
<circle cx="41.00" cy="39.00" r="0.80" />
<circle cx="3.00" cy="41.00" r="0.80" />
<circle cx="5.00" cy="41.00" r="0.80" />
<circle cx="9.00" cy="41.00" r="0.80" />
<circle cx="13.00" cy="41.00" r="0.80" />
<circle cx="15.00" cy="41.00" r="0.80" />
<circle cx="17.00" cy="41.00" r="0.80" />
<circle cx="25.00" cy="41.00" r="0.80" />
<circle cx="19.00" cy="41.00" r="0.80" />
<circle cx="27.00" cy="41.00" r="0.80" />
<circle cx="29.00" cy="41.00" r="0.80" />
<circle cx="33.00" cy="41.00" r="0.80" />
<circle cx="31.00" cy="41.00" r="0.80" />
<circle cx="35.00" cy="41.00" r="0.80" />
<circle cx="39.00" cy="41.00" r="0.80" />
<circle cx="3.00" cy="43.00" r="0.80" />
<circle cx="5.00" cy="43.00" r="0.80" />

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -22,126 +22,147 @@
<circle cx="37.00" cy="5.00" r="0.80" />
<circle cx="1.00" cy="7.00" r="0.80" />
<circle cx="5.00" cy="7.00" r="0.80" />
<circle cx="11.00" cy="7.00" r="0.80" />
<circle cx="7.00" cy="7.00" r="0.80" />
<circle cx="9.00" cy="7.00" r="0.80" />
<circle cx="13.00" cy="7.00" r="0.80" />
<circle cx="17.00" cy="7.00" r="0.80" />
<circle cx="19.00" cy="7.00" r="0.80" />
<circle cx="23.00" cy="7.00" r="0.80" />
<circle cx="27.00" cy="7.00" r="0.80" />
<circle cx="33.00" cy="7.00" r="0.80" />
<circle cx="35.00" cy="7.00" r="0.80" />
<circle cx="25.00" cy="7.00" r="0.80" />
<circle cx="29.00" cy="7.00" r="0.80" />
<circle cx="37.00" cy="7.00" r="0.80" />
<circle cx="39.00" cy="7.00" r="0.80" />
<circle cx="1.00" cy="9.00" r="0.80" />
<circle cx="5.00" cy="9.00" r="0.80" />
<circle cx="7.00" cy="9.00" r="0.80" />
<circle cx="9.00" cy="9.00" r="0.80" />
<circle cx="13.00" cy="9.00" r="0.80" />
<circle cx="17.00" cy="9.00" r="0.80" />
<circle cx="21.00" cy="9.00" r="0.80" />
<circle cx="15.00" cy="9.00" r="0.80" />
<circle cx="19.00" cy="9.00" r="0.80" />
<circle cx="25.00" cy="9.00" r="0.80" />
<circle cx="27.00" cy="9.00" r="0.80" />
<circle cx="31.00" cy="9.00" r="0.80" />
<circle cx="33.00" cy="9.00" r="0.80" />
<circle cx="35.00" cy="9.00" r="0.80" />
<circle cx="1.00" cy="11.00" r="0.80" />
<circle cx="5.00" cy="11.00" r="0.80" />
<circle cx="7.00" cy="11.00" r="0.80" />
<circle cx="9.00" cy="11.00" r="0.80" />
<circle cx="11.00" cy="11.00" r="0.80" />
<circle cx="13.00" cy="11.00" r="0.80" />
<circle cx="15.00" cy="11.00" r="0.80" />
<circle cx="25.00" cy="11.00" r="0.80" />
<circle cx="19.00" cy="11.00" r="0.80" />
<circle cx="21.00" cy="11.00" r="0.80" />
<circle cx="23.00" cy="11.00" r="0.80" />
<circle cx="27.00" cy="11.00" r="0.80" />
<circle cx="29.00" cy="11.00" r="0.80" />
<circle cx="31.00" cy="11.00" r="0.80" />
<circle cx="35.00" cy="11.00" r="0.80" />
<circle cx="33.00" cy="11.00" r="0.80" />
<circle cx="37.00" cy="11.00" r="0.80" />
<circle cx="39.00" cy="11.00" r="0.80" />
<circle cx="1.00" cy="13.00" r="0.80" />
<circle cx="5.00" cy="13.00" r="0.80" />
<circle cx="9.00" cy="13.00" r="0.80" />
<circle cx="7.00" cy="13.00" r="0.80" />
<circle cx="11.00" cy="13.00" r="0.80" />
<circle cx="13.00" cy="13.00" r="0.80" />
<circle cx="15.00" cy="13.00" r="0.80" />
<circle cx="17.00" cy="13.00" r="0.80" />
<circle cx="19.00" cy="13.00" r="0.80" />
<circle cx="21.00" cy="13.00" r="0.80" />
<circle cx="27.00" cy="13.00" r="0.80" />
<circle cx="31.00" cy="13.00" r="0.80" />
<circle cx="33.00" cy="13.00" r="0.80" />
<circle cx="37.00" cy="13.00" r="0.80" />
<circle cx="1.00" cy="15.00" r="0.80" />
<circle cx="11.00" cy="15.00" r="0.80" />
<circle cx="5.00" cy="15.00" r="0.80" />
<circle cx="7.00" cy="15.00" r="0.80" />
<circle cx="9.00" cy="15.00" r="0.80" />
<circle cx="13.00" cy="15.00" r="0.80" />
<circle cx="17.00" cy="15.00" r="0.80" />
<circle cx="19.00" cy="15.00" r="0.80" />
<circle cx="23.00" cy="15.00" r="0.80" />
<circle cx="25.00" cy="15.00" r="0.80" />
<circle cx="27.00" cy="15.00" r="0.80" />
<circle cx="29.00" cy="15.00" r="0.80" />
<circle cx="33.00" cy="15.00" r="0.80" />
<circle cx="37.00" cy="15.00" r="0.80" />
<circle cx="39.00" cy="15.00" r="0.80" />
<circle cx="1.00" cy="17.00" r="0.80" />
<circle cx="3.00" cy="17.00" r="0.80" />
<circle cx="13.00" cy="17.00" r="0.80" />
<circle cx="9.00" cy="17.00" r="0.80" />
<circle cx="11.00" cy="17.00" r="0.80" />
<circle cx="15.00" cy="17.00" r="0.80" />
<circle cx="17.00" cy="17.00" r="0.80" />
<circle cx="19.00" cy="17.00" r="0.80" />
<circle cx="21.00" cy="17.00" r="0.80" />
<circle cx="23.00" cy="17.00" r="0.80" />
<circle cx="25.00" cy="17.00" r="0.80" />
<circle cx="27.00" cy="17.00" r="0.80" />
<circle cx="29.00" cy="17.00" r="0.80" />
<circle cx="31.00" cy="17.00" r="0.80" />
<circle cx="33.00" cy="17.00" r="0.80" />
<circle cx="35.00" cy="17.00" r="0.80" />
<circle cx="37.00" cy="17.00" r="0.80" />
<circle cx="1.00" cy="19.00" r="0.80" />
<circle cx="3.00" cy="19.00" r="0.80" />
<circle cx="5.00" cy="19.00" r="0.80" />
<circle cx="7.00" cy="19.00" r="0.80" />
<circle cx="11.00" cy="19.00" r="0.80" />
<circle cx="15.00" cy="19.00" r="0.80" />
<circle cx="17.00" cy="19.00" r="0.80" />
<circle cx="19.00" cy="19.00" r="0.80" />
<circle cx="21.00" cy="19.00" r="0.80" />
<circle cx="23.00" cy="19.00" r="0.80" />
<circle cx="25.00" cy="19.00" r="0.80" />
<circle cx="27.00" cy="19.00" r="0.80" />
<circle cx="29.00" cy="19.00" r="0.80" />
<circle cx="31.00" cy="19.00" r="0.80" />
<circle cx="35.00" cy="19.00" r="0.80" />
<circle cx="37.00" cy="19.00" r="0.80" />
<circle cx="39.00" cy="19.00" r="0.80" />
<circle cx="1.00" cy="21.00" r="0.80" />
<circle cx="3.00" cy="21.00" r="0.80" />
<circle cx="5.00" cy="21.00" r="0.80" />
<circle cx="7.00" cy="21.00" r="0.80" />
<circle cx="15.00" cy="21.00" r="0.80" />
<circle cx="17.00" cy="21.00" r="0.80" />
<circle cx="19.00" cy="21.00" r="0.80" />
<circle cx="25.00" cy="21.00" r="0.80" />
<circle cx="21.00" cy="21.00" r="0.80" />
<circle cx="23.00" cy="21.00" r="0.80" />
<circle cx="33.00" cy="21.00" r="0.80" />
<circle cx="35.00" cy="21.00" r="0.80" />
<circle cx="1.00" cy="23.00" r="0.80" />
<circle cx="3.00" cy="23.00" r="0.80" />
<circle cx="7.00" cy="23.00" r="0.80" />
<circle cx="9.00" cy="23.00" r="0.80" />
<circle cx="15.00" cy="23.00" r="0.80" />
<circle cx="17.00" cy="23.00" r="0.80" />
<circle cx="33.00" cy="23.00" r="0.80" />
<circle cx="19.00" cy="23.00" r="0.80" />
<circle cx="21.00" cy="23.00" r="0.80" />
<circle cx="27.00" cy="23.00" r="0.80" />
<circle cx="35.00" cy="23.00" r="0.80" />
<circle cx="39.00" cy="23.00" r="0.80" />
<circle cx="1.00" cy="25.00" r="0.80" />
<circle cx="3.00" cy="25.00" r="0.80" />
<circle cx="5.00" cy="25.00" r="0.80" />
<circle cx="7.00" cy="25.00" r="0.80" />
<circle cx="9.00" cy="25.00" r="0.80" />
<circle cx="11.00" cy="25.00" r="0.80" />
<circle cx="15.00" cy="25.00" r="0.80" />
<circle cx="19.00" cy="25.00" r="0.80" />
<circle cx="21.00" cy="25.00" r="0.80" />
<circle cx="23.00" cy="25.00" r="0.80" />
<circle cx="27.00" cy="25.00" r="0.80" />
<circle cx="25.00" cy="25.00" r="0.80" />
<circle cx="29.00" cy="25.00" r="0.80" />
<circle cx="33.00" cy="25.00" r="0.80" />
<circle cx="37.00" cy="25.00" r="0.80" />
<circle cx="1.00" cy="27.00" r="0.80" />
<circle cx="5.00" cy="27.00" r="0.80" />
<circle cx="7.00" cy="27.00" r="0.80" />
<circle cx="9.00" cy="27.00" r="0.80" />
<circle cx="11.00" cy="27.00" r="0.80" />
<circle cx="13.00" cy="27.00" r="0.80" />
<circle cx="17.00" cy="27.00" r="0.80" />
<circle cx="15.00" cy="27.00" r="0.80" />
<circle cx="19.00" cy="27.00" r="0.80" />
<circle cx="31.00" cy="27.00" r="0.80" />
<circle cx="37.00" cy="27.00" r="0.80" />
<circle cx="27.00" cy="27.00" r="0.80" />
<circle cx="35.00" cy="27.00" r="0.80" />
<circle cx="39.00" cy="27.00" r="0.80" />
<circle cx="1.00" cy="29.00" r="0.80" />
<circle cx="3.00" cy="29.00" r="0.80" />
<circle cx="5.00" cy="29.00" r="0.80" />
<circle cx="9.00" cy="29.00" r="0.80" />
<circle cx="11.00" cy="29.00" r="0.80" />
<circle cx="13.00" cy="29.00" r="0.80" />
<circle cx="15.00" cy="29.00" r="0.80" />
<circle cx="17.00" cy="29.00" r="0.80" />
<circle cx="25.00" cy="29.00" r="0.80" />
<circle cx="27.00" cy="29.00" r="0.80" />
<circle cx="31.00" cy="29.00" r="0.80" />
<circle cx="29.00" cy="29.00" r="0.80" />
<circle cx="1.00" cy="31.00" r="0.80" />
<circle cx="3.00" cy="31.00" r="0.80" />
<circle cx="11.00" cy="31.00" r="0.80" />
<circle cx="13.00" cy="31.00" r="0.80" />
<circle cx="15.00" cy="31.00" r="0.80" />
<circle cx="17.00" cy="31.00" r="0.80" />
<circle cx="23.00" cy="31.00" r="0.80" />
<circle cx="25.00" cy="31.00" r="0.80" />
<circle cx="35.00" cy="31.00" r="0.80" />
<circle cx="27.00" cy="31.00" r="0.80" />
<circle cx="29.00" cy="31.00" r="0.80" />
<circle cx="31.00" cy="31.00" r="0.80" />
<circle cx="33.00" cy="31.00" r="0.80" />
<circle cx="37.00" cy="31.00" r="0.80" />
<circle cx="39.00" cy="31.00" r="0.80" />
<circle cx="1.00" cy="33.00" r="0.80" />
@ -150,50 +171,61 @@
<circle cx="11.00" cy="33.00" r="0.80" />
<circle cx="15.00" cy="33.00" r="0.80" />
<circle cx="17.00" cy="33.00" r="0.80" />
<circle cx="25.00" cy="33.00" r="0.80" />
<circle cx="21.00" cy="33.00" r="0.80" />
<circle cx="23.00" cy="33.00" r="0.80" />
<circle cx="27.00" cy="33.00" r="0.80" />
<circle cx="29.00" cy="33.00" r="0.80" />
<circle cx="35.00" cy="33.00" r="0.80" />
<circle cx="37.00" cy="33.00" r="0.80" />
<circle cx="1.00" cy="35.00" r="0.80" />
<circle cx="3.00" cy="35.00" r="0.80" />
<circle cx="11.00" cy="35.00" r="0.80" />
<circle cx="13.00" cy="35.00" r="0.80" />
<circle cx="15.00" cy="35.00" r="0.80" />
<circle cx="17.00" cy="35.00" r="0.80" />
<circle cx="19.00" cy="35.00" r="0.80" />
<circle cx="21.00" cy="35.00" r="0.80" />
<circle cx="23.00" cy="35.00" r="0.80" />
<circle cx="25.00" cy="35.00" r="0.80" />
<circle cx="27.00" cy="35.00" r="0.80" />
<circle cx="35.00" cy="35.00" r="0.80" />
<circle cx="29.00" cy="35.00" r="0.80" />
<circle cx="31.00" cy="35.00" r="0.80" />
<circle cx="37.00" cy="35.00" r="0.80" />
<circle cx="39.00" cy="35.00" r="0.80" />
<circle cx="1.00" cy="37.00" r="0.80" />
<circle cx="3.00" cy="37.00" r="0.80" />
<circle cx="11.00" cy="37.00" r="0.80" />
<circle cx="15.00" cy="37.00" r="0.80" />
<circle cx="7.00" cy="37.00" r="0.80" />
<circle cx="9.00" cy="37.00" r="0.80" />
<circle cx="19.00" cy="37.00" r="0.80" />
<circle cx="21.00" cy="37.00" r="0.80" />
<circle cx="23.00" cy="37.00" r="0.80" />
<circle cx="25.00" cy="37.00" r="0.80" />
<circle cx="27.00" cy="37.00" r="0.80" />
<circle cx="29.00" cy="37.00" r="0.80" />
<circle cx="31.00" cy="37.00" r="0.80" />
<circle cx="33.00" cy="37.00" r="0.80" />
<circle cx="35.00" cy="37.00" r="0.80" />
<circle cx="1.00" cy="39.00" r="0.80" />
<circle cx="3.00" cy="39.00" r="0.80" />
<circle cx="5.00" cy="39.00" r="0.80" />
<circle cx="7.00" cy="39.00" r="0.80" />
<circle cx="9.00" cy="39.00" r="0.80" />
<circle cx="13.00" cy="39.00" r="0.80" />
<circle cx="19.00" cy="39.00" r="0.80" />
<circle cx="21.00" cy="39.00" r="0.80" />
<circle cx="23.00" cy="39.00" r="0.80" />
<circle cx="25.00" cy="39.00" r="0.80" />
<circle cx="27.00" cy="39.00" r="0.80" />
<circle cx="29.00" cy="39.00" r="0.80" />
<circle cx="31.00" cy="39.00" r="0.80" />
<circle cx="33.00" cy="39.00" r="0.80" />
<circle cx="35.00" cy="39.00" r="0.80" />
<circle cx="39.00" cy="39.00" r="0.80" />
<circle cx="1.00" cy="41.00" r="0.80" />
<circle cx="3.00" cy="41.00" r="0.80" />
<circle cx="7.00" cy="41.00" r="0.80" />
<circle cx="11.00" cy="41.00" r="0.80" />
<circle cx="13.00" cy="41.00" r="0.80" />
<circle cx="15.00" cy="41.00" r="0.80" />
<circle cx="23.00" cy="41.00" r="0.80" />
<circle cx="17.00" cy="41.00" r="0.80" />
<circle cx="25.00" cy="41.00" r="0.80" />
<circle cx="27.00" cy="41.00" r="0.80" />
<circle cx="31.00" cy="41.00" r="0.80" />
<circle cx="29.00" cy="41.00" r="0.80" />
<circle cx="33.00" cy="41.00" r="0.80" />
<circle cx="37.00" cy="41.00" r="0.80" />
<circle cx="1.00" cy="43.00" r="0.80" />
<circle cx="3.00" cy="43.00" r="0.80" />

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because it is too large Load diff

View file

@ -1,969 +0,0 @@
/*
libzint - the open source barcode library
Copyright (C) 2021 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.
*/
/* vim: set ts=4 sw=4 et : */
/* Used by test_matrix.c test_minimize() (TODO: remove in the not-too-distant future) */
#ifndef Z_DMATRIX_VARIANT_H
#define Z_DMATRIX_VARIANT_H
#include "../dmatrix.h"
static int dm_isc40(const unsigned char input) {
if (input <= '9') {
return input >= '0' || input == ' ';
}
return input >= 'A' && input <= 'Z';
}
/* Is basic (non-shifted) TEXT? */
static int dm_istext(const unsigned char input) {
if (input <= '9') {
return input >= '0' || input == ' ';
}
return input >= 'a' && input <= 'z';
}
/* Is basic (non-shifted) C40/TEXT? */
static int dm_isc40text(const int current_mode, const unsigned char input) {
return current_mode == DM_C40 ? dm_isc40(input) : dm_istext(input);
}
/* Return true (1) if a character is valid in X12 set */
static int dm_isX12(const unsigned char input) {
return dm_isc40(input) || input == 13 || input == '*' || input == '>';
}
/* Return true (1) if a character is valid in EDIFACT set */
static int dm_isedifact(const unsigned char input, const int gs1) {
return (input >= ' ' && input <= '^') && (!gs1 || input != '['); /* Can't encode GS1 FNC1/GS in EDIFACT */
}
static int dm_p_r_6_2_1(const unsigned char source[], const int length, const int sp) {
/* Annex P section (r)(6)(ii)(I)
"If one of the three X12 terminator/separator characters first
occurs in the yet to be processed data before a non-X12 character..."
*/
int i;
for (i = sp; i < length && dm_isX12(source[i]); i++) {
if (source[i] == 13 || source[i] == '*' || source[i] == '>') {
return 1;
}
}
return 0;
}
/* Count number of TEXT characters around `sp` between `position` and `length`
- helper to avoid exiting from Base 256 too early if have series of TEXT characters */
static int dm_text_sp_cnt(const unsigned char source[], const int position, const int length, const int sp) {
int i;
int cnt = 0;
/* Count from `sp` forward */
for (i = sp; i < length && dm_istext(source[i]); i++, cnt++);
/* Count backwards from `sp` */
for (i = sp - 1; i >= position && dm_istext(source[i]); i--, cnt++);
return cnt;
}
#define DM_MULT 12
#define DM_MULT_1_DIV_2 6
#define DM_MULT_2_DIV_3 8
#define DM_MULT_3_DIV_4 9
#define DM_MULT_1 12
#define DM_MULT_5_DIV_4 15
#define DM_MULT_4_DIV_3 16
#define DM_MULT_2 24
#define DM_MULT_9_DIV_4 27
#define DM_MULT_8_DIV_3 32
#define DM_MULT_3 26
#define DM_MULT_13_DIV_4 39
#define DM_MULT_10_DIV_3 40
#define DM_MULT_4 48
#define DM_MULT_17_DIV_4 51
#define DM_MULT_13_DIV_3 52
#define DM_MULT_MINUS_1 11
#define DM_MULT_CEIL(n) ((((n) + DM_MULT_MINUS_1) / DM_MULT) * DM_MULT)
static int dm_look_ahead_test_variant(const unsigned char source[], const int length, const int position,
const int current_mode, const int mode_arg, const int gs1, const int debug_print, const int variant) {
int ascii_count, c40_count, text_count, x12_count, edf_count, b256_count;
int ascii_rnded, c40_rnded, text_rnded, x12_rnded, edf_rnded, b256_rnded;
int cnt_1;
int sp;
int ascii_init_test, loop_test, edf_eod_test, x12_eod_test;
/* step (j) */
if (variant == 1) {
ascii_init_test = (current_mode == DM_ASCII || current_mode == DM_BASE256);
} else {
ascii_init_test = (current_mode == DM_ASCII);
}
if (ascii_init_test) {
ascii_count = 0;
c40_count = DM_MULT_1;
text_count = DM_MULT_1;
x12_count = DM_MULT_1;
edf_count = DM_MULT_1;
if (variant == 1) {
b256_count = DM_MULT_2;
} else {
b256_count = DM_MULT_5_DIV_4; // 1.25
}
} else {
ascii_count = DM_MULT_1;
c40_count = DM_MULT_2;
text_count = DM_MULT_2;
x12_count = DM_MULT_2;
edf_count = DM_MULT_2;
if (variant == 1) {
b256_count = DM_MULT_3;
} else {
b256_count = DM_MULT_9_DIV_4; // 2.25
}
}
switch (current_mode) {
case DM_C40: c40_count = 0;
break;
case DM_TEXT: text_count = 0;
break;
case DM_X12: x12_count = 0;
break;
case DM_EDIFACT: edf_count = 0;
break;
case DM_BASE256:
if (variant == 1) {
b256_count = mode_arg == 249 ? DM_MULT_1 : 0;
} else {
b256_count = 0;
}
break;
}
for (sp = position; sp < length; sp++) {
unsigned char c = source[sp];
int is_extended = c & 0x80;
/* ascii ... step (l) */
if ((c >= '0') && (c <= '9')) {
ascii_count += DM_MULT_1_DIV_2; // (l)(1)
} else {
if (is_extended) {
ascii_count = DM_MULT_CEIL(ascii_count) + DM_MULT_2; // (l)(2)
} else {
ascii_count = DM_MULT_CEIL(ascii_count) + DM_MULT_1; // (l)(3)
}
}
/* c40 ... step (m) */
if (dm_isc40(c)) {
c40_count += DM_MULT_2_DIV_3; // (m)(1)
} else {
if (is_extended) {
c40_count += DM_MULT_8_DIV_3; // (m)(2)
} else {
c40_count += DM_MULT_4_DIV_3; // (m)(3)
}
}
/* text ... step (n) */
if (dm_istext(c)) {
text_count += DM_MULT_2_DIV_3; // (n)(1)
} else {
if (is_extended) {
text_count += DM_MULT_8_DIV_3; // (n)(2)
} else {
text_count += DM_MULT_4_DIV_3; // (n)(3)
}
}
/* x12 ... step (o) */
if (dm_isX12(c)) {
x12_count += DM_MULT_2_DIV_3; // (o)(1)
} else {
if (is_extended) {
x12_count += DM_MULT_13_DIV_3; // (o)(2)
} else {
x12_count += DM_MULT_10_DIV_3; // (o)(3)
}
}
/* edifact ... step (p) */
if (dm_isedifact(c, gs1)) {
edf_count += DM_MULT_3_DIV_4; // (p)(1)
} else {
if (is_extended) {
edf_count += DM_MULT_17_DIV_4; // (p)(2)
} else {
edf_count += DM_MULT_13_DIV_4; // (p)(3)
}
}
/* base 256 ... step (q) */
if ((gs1 == 1) && (c == '[')) {
/* FNC1 separator */
b256_count += DM_MULT_4; // (q)(1)
} else {
b256_count += DM_MULT_1; // (q)(2)
}
if (variant == 1) {
loop_test = sp >= position + 3;
} else {
loop_test = sp >= position + 4;
}
if (loop_test) {
int ascii_loop_test;
/* At least 5 data characters processed ... step (r) */
/* NOTE: different than spec, where it's at least 4. Following previous behaviour here (and BWIPP) */
if (debug_print) {
printf("\n(m:%d, p:%d, sp:%d, a:%d): ascii_count %d, b256_count %d, edf_count %d, text_count %d"
", x12_count %d, c40_count %d ",
current_mode, position, sp, mode_arg, ascii_count, b256_count, edf_count, text_count,
x12_count, c40_count);
}
cnt_1 = ascii_count + DM_MULT_1;
if (variant == 1) {
ascii_loop_test = (cnt_1 < b256_count && cnt_1 <= edf_count && cnt_1 <= text_count && cnt_1 <= x12_count && cnt_1 <= c40_count);
} else {
ascii_loop_test = (cnt_1 <= b256_count && cnt_1 <= edf_count && cnt_1 <= text_count && cnt_1 <= x12_count && cnt_1 <= c40_count);
}
if (ascii_loop_test) {
if (debug_print) printf("ASC->");
return DM_ASCII; /* step (r)(1) */
}
cnt_1 = b256_count + DM_MULT_1;
if (cnt_1 <= ascii_count || (cnt_1 < edf_count && cnt_1 < text_count && cnt_1 < x12_count
&& cnt_1 < c40_count)) {
if (debug_print) printf("BAS->");
return DM_BASE256; /* step (r)(2) */
}
cnt_1 = edf_count + DM_MULT_1;
if (cnt_1 < ascii_count && cnt_1 < b256_count && cnt_1 < text_count && cnt_1 < x12_count
&& cnt_1 < c40_count) {
if (debug_print) printf("EDI->");
return DM_EDIFACT; /* step (r)(3) */
}
cnt_1 = text_count + DM_MULT_1;
if (cnt_1 < ascii_count && cnt_1 < b256_count && cnt_1 < edf_count && cnt_1 < x12_count
&& cnt_1 < c40_count) {
if (variant == 1) {
if (current_mode == DM_BASE256 && position + 6 < length) {
int text_sp_cnt = dm_text_sp_cnt(source, position, length, sp);
if (debug_print) printf("text_sp_cnt %d\n", text_sp_cnt);
if (text_sp_cnt >= 12) {
if (debug_print) printf("TEX->");
return DM_TEXT; /* step (r)(4) */
}
} else {
if (debug_print) printf("TEX->");
return DM_TEXT; /* step (r)(4) */
}
} else {
if (debug_print) printf("TEX->");
return DM_TEXT; /* step (r)(4) */
}
}
cnt_1 = x12_count + DM_MULT_1;
if (cnt_1 < ascii_count && cnt_1 < b256_count && cnt_1 < edf_count && cnt_1 < text_count
&& cnt_1 < c40_count) {
if (debug_print) printf("X12->");
return DM_X12; /* step (r)(5) */
}
cnt_1 = c40_count + DM_MULT_1;
if (cnt_1 < ascii_count && cnt_1 < b256_count && cnt_1 < edf_count && cnt_1 < text_count) {
if (c40_count < x12_count) {
if (debug_print) printf("C40->");
return DM_C40; /* step (r)(6)(i) */
}
if (c40_count == x12_count) {
if (dm_p_r_6_2_1(source, length, sp) == 1) {
if (debug_print) printf("X12->");
return DM_X12; /* step (r)(6)(ii)(I) */
}
if (debug_print) printf("C40->");
return DM_C40; /* step (r)(6)(ii)(II) */
}
}
}
}
/* At the end of data ... step (k) */
/* step (k)(1) */
ascii_rnded = DM_MULT_CEIL(ascii_count);
b256_rnded = DM_MULT_CEIL(b256_count);
edf_rnded = DM_MULT_CEIL(edf_count);
text_rnded = DM_MULT_CEIL(text_count);
x12_rnded = DM_MULT_CEIL(x12_count);
c40_rnded = DM_MULT_CEIL(c40_count);
if (debug_print) {
printf("\nEOD(m:%d, p:%d, a:%d): ascii_rnded %d, b256_rnded %d, edf_rnded %d, text_rnded %d, x12_rnded %d (%d)"
", c40_rnded %d (%d) ",
current_mode, position, mode_arg, ascii_rnded, b256_rnded, edf_rnded, text_rnded, x12_rnded, x12_count,
c40_rnded, c40_count);
}
if (ascii_rnded <= b256_rnded && ascii_rnded <= edf_rnded && ascii_rnded <= text_rnded && ascii_rnded <= x12_rnded
&& ascii_rnded <= c40_rnded) {
if (debug_print) printf("ASC->");
return DM_ASCII; /* step (k)(2) */
}
if (b256_rnded < ascii_rnded && b256_rnded < edf_rnded && b256_rnded < text_rnded && b256_rnded < x12_rnded
&& b256_rnded < c40_rnded) {
if (debug_print) printf("BAS->");
return DM_BASE256; /* step (k)(3) */
}
if (variant == 1) {
edf_eod_test = (edf_rnded < ascii_rnded && edf_rnded < b256_rnded && edf_rnded < text_rnded && edf_rnded <= x12_rnded && edf_rnded < c40_rnded);
} else {
edf_eod_test = (edf_rnded < ascii_rnded && edf_rnded < b256_rnded && edf_rnded < text_rnded && edf_rnded < x12_rnded && edf_rnded < c40_rnded);
}
if (edf_eod_test) {
if (debug_print) printf("EDI->");
return DM_EDIFACT; /* step (k)(4) */
}
if (text_rnded < ascii_rnded && text_rnded < b256_rnded && text_rnded < edf_rnded && text_rnded < x12_rnded
&& text_rnded < c40_rnded) {
if (debug_print) printf("TEX->");
return DM_TEXT; /* step (k)(5) */
}
if (variant == 1) {
x12_eod_test = (x12_rnded < ascii_rnded && x12_rnded < b256_rnded && x12_rnded <= edf_rnded && x12_rnded < text_rnded && x12_rnded < c40_rnded);
} else {
x12_eod_test = (x12_rnded < ascii_rnded && x12_rnded < b256_rnded && x12_rnded < edf_rnded && x12_rnded < text_rnded && x12_rnded < c40_rnded);
}
if (x12_eod_test) {
if (debug_print) printf("X12->");
return DM_X12; /* step (k)(6) */
}
/* Note the algorithm is particularly sub-optimal here, returning C40 even if X12/EDIFACT (much) better, due to
the < comparisons of rounded X12/EDIFACT values to each other above - comparisons would need to be <= or
unrounded (cf. very similar Code One algorithm). Not changed to maintain compatibility with spec and BWIPP */
if (debug_print) printf("C40->");
return DM_C40; /* step (k)(7) */
}
/* Copy C40/TEXT/X12 triplets from buffer to target. Returns elements left in buffer (< 3) */
static int dm_ctx_buffer_xfer(int process_buffer[8], int process_p, unsigned char target[], int *p_tp,
const int debug_print) {
int i, process_e;
int tp = *p_tp;
process_e = (process_p / 3) * 3;
for (i = 0; i < process_e; i += 3) {
int iv = (1600 * process_buffer[i]) + (40 * process_buffer[i + 1]) + (process_buffer[i + 2]) + 1;
target[tp++] = (unsigned char) (iv >> 8);
target[tp++] = (unsigned char) (iv & 0xFF);
if (debug_print) {
printf("[%d %d %d (%d %d)] ", process_buffer[i], process_buffer[i + 1], process_buffer[i + 2],
target[tp - 2], target[tp - 1]);
}
}
process_p -= process_e;
if (process_p) {
memmove(process_buffer, process_buffer + process_e, sizeof(int) * process_p);
}
*p_tp = tp;
return process_p;
}
/* Copy EDIFACT quadruplets from buffer to target. Returns elements left in buffer (< 4) */
static int dm_edi_buffer_xfer(int process_buffer[8], int process_p, unsigned char target[], int *p_tp,
const int empty, const int debug_print) {
int i, process_e;
int tp = *p_tp;
process_e = (process_p / 4) * 4;
for (i = 0; i < process_e; i += 4) {
target[tp++] = (unsigned char) (process_buffer[i] << 2 | (process_buffer[i + 1] & 0x30) >> 4);
target[tp++] = (unsigned char) ((process_buffer[i + 1] & 0x0f) << 4 | (process_buffer[i + 2] & 0x3c) >> 2);
target[tp++] = (unsigned char) ((process_buffer[i + 2] & 0x03) << 6 | process_buffer[i + 3]);
if (debug_print) {
printf("[%d %d %d %d (%d %d %d)] ", process_buffer[i], process_buffer[i + 1], process_buffer[i + 2],
process_buffer[i + 3], target[tp - 3], target[tp - 2], target[tp - 1]);
}
}
process_p -= process_e;
if (process_p) {
memmove(process_buffer, process_buffer + process_e, sizeof(int) * process_p);
if (empty) {
if (process_p == 3) {
target[tp++] = (unsigned char) (process_buffer[i] << 2 | (process_buffer[i + 1] & 0x30) >> 4);
target[tp++] = (unsigned char) ((process_buffer[i + 1] & 0x0f) << 4
| (process_buffer[i + 2] & 0x3c) >> 2);
target[tp++] = (unsigned char) ((process_buffer[i + 2] & 0x03) << 6);
if (debug_print) {
printf("[%d %d %d (%d %d %d)] ", process_buffer[i], process_buffer[i + 1], process_buffer[i + 2],
target[tp - 3], target[tp - 2], target[tp - 1]);
}
} else if (process_p == 2) {
target[tp++] = (unsigned char) (process_buffer[i] << 2 | (process_buffer[i + 1] & 0x30) >> 4);
target[tp++] = (unsigned char) ((process_buffer[i + 1] & 0x0f) << 4);
if (debug_print) {
printf("[%d %d (%d %d)] ", process_buffer[i], process_buffer[i + 1], target[tp - 2],
target[tp - 1]);
}
} else {
target[tp++] = (unsigned char) (process_buffer[i] << 2);
if (debug_print) printf("[%d (%d)] ", process_buffer[i], target[tp - 1]);
}
process_p = 0;
}
}
*p_tp = tp;
return process_p;
}
STATIC_UNLESS_ZINT_TEST int dm_get_symbolsize(struct zint_symbol *symbol, const int minimum);
STATIC_UNLESS_ZINT_TEST int dm_codewords_remaining(struct zint_symbol *symbol, const int tp, const int process_p);
STATIC_UNLESS_ZINT_TEST int dm_c40text_cnt(const int current_mode, const int gs1, unsigned char input);
STATIC_UNLESS_ZINT_TEST int dm_update_b256_field_length(unsigned char target[], int tp, int b256_start);
STATIC_UNLESS_ZINT_TEST int dm_switch_mode(const int next_mode, unsigned char target[], int tp, int *b256_start,
const int debug_print);
/* Version of dm200encode() to check variant look ahead parameters */
static int dm200encode_variant(struct zint_symbol *symbol, const unsigned char source[], unsigned char target[],
int *p_length, int *p_binlen, const int variant) {
int sp;
int tp, i, gs1;
int current_mode, next_mode;
int not_first = 0;
int inputlen = *p_length;
int process_buffer[8]; /* holds remaining data to finalised */
int process_p = 0; /* number of characters left to finalise */
int b256_start = 0;
int symbols_left;
const int debug_print = symbol->debug & ZINT_DEBUG_PRINT;
sp = 0;
tp = 0;
if (symbol->structapp.count) {
int id1, id2;
if (symbol->structapp.count < 2 || symbol->structapp.count > 16) {
strcpy(symbol->errtxt, "720: Structured Append count out of range (2-16)");
return ZINT_ERROR_INVALID_OPTION;
}
if (symbol->structapp.index < 1 || symbol->structapp.index > symbol->structapp.count) {
sprintf(symbol->errtxt, "721: Structured Append index out of range (1-%d)", symbol->structapp.count);
return ZINT_ERROR_INVALID_OPTION;
}
if (symbol->structapp.id[0]) {
int id, id_len, id1_err, id2_err;
for (id_len = 0; id_len < 32 && symbol->structapp.id[id_len]; id_len++);
if (id_len > 6) { /* ID1 * 1000 + ID2 */
strcpy(symbol->errtxt, "722: Structured Append ID too long (6 digit maximum)");
return ZINT_ERROR_INVALID_OPTION;
}
id = to_int((const unsigned char *) symbol->structapp.id, id_len);
if (id == -1) {
strcpy(symbol->errtxt, "723: Invalid Structured Append ID (digits only)");
return ZINT_ERROR_INVALID_OPTION;
}
id1 = id / 1000;
id2 = id % 1000;
id1_err = id1 < 1 || id1 > 254;
id2_err = id2 < 1 || id2 > 254;
if (id1_err || id2_err) {
if (id1_err && id2_err) {
sprintf(symbol->errtxt,
"724: Structured Append ID1 '%03d' and ID2 '%03d' out of range (001-254) (ID '%03d%03d')",
id1, id2, id1, id2);
} else if (id1_err) {
sprintf(symbol->errtxt,
"725: Structured Append ID1 '%03d' out of range (001-254) (ID '%03d%03d')",
id1, id1, id2);
} else {
sprintf(symbol->errtxt,
"726: Structured Append ID2 '%03d' out of range (001-254) (ID '%03d%03d')",
id2, id1, id2);
}
return ZINT_ERROR_INVALID_OPTION;
}
} else {
id1 = id2 = 1;
}
target[tp++] = 233;
target[tp++] = (17 - symbol->structapp.count) | ((symbol->structapp.index - 1) << 4);
target[tp++] = id1;
target[tp++] = id2;
}
/* gs1 flag values: 0: no gs1, 1: gs1 with FNC1 serparator, 2: GS separator */
if ((symbol->input_mode & 0x07) == GS1_MODE) {
if (symbol->output_options & GS1_GS_SEPARATOR) {
gs1 = 2;
} else {
gs1 = 1;
}
} else {
gs1 = 0;
}
if (gs1) {
target[tp++] = 232;
if (debug_print) printf("FN1 ");
} /* FNC1 */
if (symbol->output_options & READER_INIT) {
if (gs1) {
strcpy(symbol->errtxt, "521: Cannot encode in GS1 mode and Reader Initialisation at the same time");
return ZINT_ERROR_INVALID_OPTION;
}
if (symbol->structapp.count) {
strcpy(symbol->errtxt, "727: Cannot have Structured Append and Reader Initialisation at the same time");
return ZINT_ERROR_INVALID_OPTION;
}
target[tp++] = 234; /* Reader Programming */
if (debug_print) printf("RP ");
}
if (symbol->eci > 0) {
/* Encode ECI numbers according to Table 6 */
target[tp++] = 241; /* ECI Character */
if (symbol->eci <= 126) {
target[tp++] = (unsigned char) (symbol->eci + 1);
} else if (symbol->eci <= 16382) {
target[tp++] = (unsigned char) ((symbol->eci - 127) / 254 + 128);
target[tp++] = (unsigned char) ((symbol->eci - 127) % 254 + 1);
} else {
target[tp++] = (unsigned char) ((symbol->eci - 16383) / 64516 + 192);
target[tp++] = (unsigned char) (((symbol->eci - 16383) / 254) % 254 + 1);
target[tp++] = (unsigned char) ((symbol->eci - 16383) % 254 + 1);
}
if (debug_print) printf("ECI %d ", symbol->eci + 1);
}
/* Check for Macro05/Macro06 */
/* "[)>[RS]05[GS]...[RS][EOT]" -> CW 236 */
/* "[)>[RS]06[GS]...[RS][EOT]" -> CW 237 */
if (tp == 0 && sp == 0 && inputlen >= 9
&& source[0] == '[' && source[1] == ')' && source[2] == '>'
&& source[3] == '\x1e' && source[4] == '0'
&& (source[5] == '5' || source[5] == '6')
&& source[6] == '\x1d'
&& source[inputlen - 2] == '\x1e' && source[inputlen - 1] == '\x04') {
/* Output macro Codeword */
if (source[5] == '5') {
target[tp++] = 236;
if (debug_print) printf("Macro05 ");
} else {
target[tp++] = 237;
if (debug_print) printf("Macro06 ");
}
/* Remove macro characters from input string */
sp = 7;
inputlen -= 2;
*p_length -= 2;
}
/* step (a) */
current_mode = DM_ASCII;
next_mode = DM_ASCII;
while (sp < inputlen) {
current_mode = next_mode;
/* step (b) - ASCII encodation */
if (current_mode == DM_ASCII) {
next_mode = DM_ASCII;
if (is_twodigits(source, inputlen, sp)) {
target[tp++] = (unsigned char) ((10 * ctoi(source[sp])) + ctoi(source[sp + 1]) + 130);
if (debug_print) printf("N%02d ", target[tp - 1] - 130);
sp += 2;
} else {
next_mode = dm_look_ahead_test_variant(source, inputlen, sp, current_mode, 0, gs1, debug_print, variant);
if (next_mode != DM_ASCII) {
tp = dm_switch_mode(next_mode, target, tp, &b256_start, debug_print);
not_first = 0;
} else {
if (source[sp] & 0x80) {
target[tp++] = 235; /* FNC4 */
target[tp++] = (source[sp] - 128) + 1;
if (debug_print) printf("FN4 A%02X ", target[tp - 1] - 1);
} else {
if (gs1 && (source[sp] == '[')) {
if (gs1 == 2) {
target[tp++] = 29 + 1; /* GS */
if (debug_print) printf("GS ");
} else {
target[tp++] = 232; /* FNC1 */
if (debug_print) printf("FN1 ");
}
} else {
target[tp++] = source[sp] + 1;
if (debug_print) printf("A%02X ", target[tp - 1] - 1);
}
}
sp++;
}
}
/* step (c)/(d) C40/TEXT encodation */
} else if (current_mode == DM_C40 || current_mode == DM_TEXT) {
next_mode = current_mode;
if (process_p == 0 && not_first) {
next_mode = dm_look_ahead_test_variant(source, inputlen, sp, current_mode, process_p, gs1, debug_print, variant);
}
if (next_mode != current_mode) {
target[tp++] = 254; /* Unlatch */
next_mode = DM_ASCII;
if (debug_print) printf("ASC ");
} else {
int shift_set, value;
const char *ct_shift, *ct_value;
if (current_mode == DM_C40) {
ct_shift = dm_c40_shift;
ct_value = dm_c40_value;
} else {
ct_shift = dm_text_shift;
ct_value = dm_text_value;
}
if (source[sp] & 0x80) {
process_buffer[process_p++] = 1;
process_buffer[process_p++] = 30; /* Upper Shift */
shift_set = ct_shift[source[sp] - 128];
value = ct_value[source[sp] - 128];
} else {
if (gs1 && (source[sp] == '[')) {
if (gs1 == 2) {
shift_set = ct_shift[29];
value = ct_value[29]; /* GS */
} else {
shift_set = 2;
value = 27; /* FNC1 */
}
} else {
shift_set = ct_shift[source[sp]];
value = ct_value[source[sp]];
}
}
if (shift_set != 0) {
process_buffer[process_p++] = shift_set - 1;
}
process_buffer[process_p++] = value;
if (process_p >= 3) {
process_p = dm_ctx_buffer_xfer(process_buffer, process_p, target, &tp, debug_print);
}
sp++;
not_first = 1;
}
/* step (e) X12 encodation */
} else if (current_mode == DM_X12) {
if (!dm_isX12(source[sp])) {
next_mode = DM_ASCII;
} else {
next_mode = DM_X12;
if (process_p == 0 && not_first) {
next_mode = dm_look_ahead_test_variant(source, inputlen, sp, current_mode, process_p, gs1, debug_print, variant);
}
}
if (next_mode != DM_X12) {
process_p = 0; /* Throw away buffer if any */
target[tp++] = 254; /* Unlatch */
next_mode = DM_ASCII;
if (debug_print) printf("ASC ");
} else {
static const char x12_nonalphanum_chars[] = "\015*> ";
int value = 0;
if ((source[sp] >= '0') && (source[sp] <= '9')) {
value = (source[sp] - '0') + 4;
} else if ((source[sp] >= 'A') && (source[sp] <= 'Z')) {
value = (source[sp] - 'A') + 14;
} else {
value = posn(x12_nonalphanum_chars, source[sp]);
}
process_buffer[process_p++] = value;
if (process_p >= 3) {
process_p = dm_ctx_buffer_xfer(process_buffer, process_p, target, &tp, debug_print);
}
sp++;
not_first = 1;
}
/* step (f) EDIFACT encodation */
} else if (current_mode == DM_EDIFACT) {
if (!dm_isedifact(source[sp], gs1)) {
next_mode = DM_ASCII;
} else {
next_mode = DM_EDIFACT;
if (process_p == 3) {
/* Note different then spec Step (f)(1), which suggests checking when 0, but this seems to work
better in many cases as the switch to ASCII is "free" */
next_mode = dm_look_ahead_test_variant(source, inputlen, sp, current_mode, process_p, gs1, debug_print, variant);
}
}
if (next_mode != DM_EDIFACT) {
process_buffer[process_p++] = 31;
process_p = dm_edi_buffer_xfer(process_buffer, process_p, target, &tp, 1 /*empty*/, debug_print);
next_mode = DM_ASCII;
if (debug_print) printf("ASC ");
} else {
int value = source[sp];
if (value >= 64) { // '@'
value -= 64;
}
process_buffer[process_p++] = value;
sp++;
not_first = 1;
if (process_p >= 4) {
process_p = dm_edi_buffer_xfer(process_buffer, process_p, target, &tp, 0 /*empty*/, debug_print);
}
}
/* step (g) Base 256 encodation */
} else if (current_mode == DM_BASE256) {
if (gs1 == 1 && source[sp] == '[') {
next_mode = DM_ASCII;
} else {
next_mode = DM_BASE256;
if (not_first) {
next_mode = dm_look_ahead_test_variant(source, inputlen, sp, current_mode, tp - (b256_start + 1), gs1,
debug_print, variant);
}
}
if (next_mode != DM_BASE256) {
tp = dm_update_b256_field_length(target, tp, b256_start);
/* B.2.1 255-state randomising algorithm */
for (i = b256_start; i < tp; i++) {
const int prn = ((149 * (i + 1)) % 255) + 1;
target[i] = (unsigned char) ((target[i] + prn) & 0xFF);
}
if (variant == 1) {
tp = dm_switch_mode(next_mode, target, tp, &b256_start, debug_print);
not_first = 0;
} else {
next_mode = DM_ASCII;
if (debug_print) printf("ASC ");
}
} else {
if (gs1 == 2 && source[sp] == '[') {
target[tp++] = 29; /* GS */
} else {
target[tp++] = source[sp];
}
sp++;
not_first = 1;
if (debug_print) printf("B%02X ", target[tp - 1]);
}
}
if (tp > 1558) {
strcpy(symbol->errtxt, "520: Data too long to fit in symbol");
return ZINT_ERROR_TOO_LONG;
}
} /* while */
symbols_left = dm_codewords_remaining(symbol, tp, process_p);
if (debug_print) printf("\nsymbols_left %d, process_p %d ", symbols_left, process_p);
if (current_mode == DM_C40 || current_mode == DM_TEXT) {
/* NOTE: changed to follow spec exactly here, only using Shift 1 padded triplets when 2 symbol chars remain.
This matches the behaviour of BWIPP but not tec-it, nor figures 4.15.1-1 and 4.15-1-2 in GS1 General
Specifications 21.0.1.
*/
if (debug_print) printf("%s ", current_mode == DM_C40 ? "C40" : "TEX");
if (process_p == 0) {
if (symbols_left > 0) {
target[tp++] = 254; // Unlatch
if (debug_print) printf("ASC ");
}
} else {
if (process_p == 2 && symbols_left == 2) {
/* 5.2.5.2 (b) */
process_buffer[process_p++] = 0; // Shift 1
(void) dm_ctx_buffer_xfer(process_buffer, process_p, target, &tp, debug_print);
} else if (process_p == 1 && symbols_left <= 2 && dm_isc40text(current_mode, source[inputlen - 1])) {
/* 5.2.5.2 (c)/(d) */
if (symbols_left > 1) {
/* 5.2.5.2 (c) */
target[tp++] = 254; // Unlatch and encode remaining data in ascii.
if (debug_print) printf("ASC ");
}
target[tp++] = source[inputlen - 1] + 1;
if (debug_print) printf("A%02X ", target[tp - 1] - 1);
} else {
int cnt, total_cnt = 0;
/* Backtrack to last complete triplet (same technique as BWIPP) */
while (sp > 0 && process_p % 3) {
sp--;
cnt = dm_c40text_cnt(current_mode, gs1, source[sp]);
total_cnt += cnt;
process_p -= cnt;
}
tp -= (total_cnt / 3) * 2;
target[tp++] = 254; // Unlatch
if (debug_print) printf("ASC ");
for (; sp < inputlen; sp++) {
if (is_twodigits(source, inputlen, sp)) {
target[tp++] = (unsigned char) ((10 * ctoi(source[sp])) + ctoi(source[sp + 1]) + 130);
if (debug_print) printf("N%02d ", target[tp - 1] - 130);
sp++;
} else if (source[sp] & 0x80) {
target[tp++] = 235; /* FNC4 */
target[tp++] = (source[sp] - 128) + 1;
if (debug_print) printf("FN4 A%02X ", target[tp - 1] - 1);
} else if (gs1 && source[sp] == '[') {
if (gs1 == 2) {
target[tp++] = 29 + 1; /* GS */
if (debug_print) printf("GS ");
} else {
target[tp++] = 232; /* FNC1 */
if (debug_print) printf("FN1 ");
}
} else {
target[tp++] = source[sp] + 1;
if (debug_print) printf("A%02X ", target[tp - 1] - 1);
}
}
}
}
} else if (current_mode == DM_X12) {
if (debug_print) printf("X12 ");
if ((symbols_left == 1) && (process_p == 1)) {
// Unlatch not required!
target[tp++] = source[inputlen - 1] + 1;
if (debug_print) printf("A%02X ", target[tp - 1] - 1);
} else {
if (symbols_left > 0) {
target[tp++] = (254); // Unlatch.
if (debug_print) printf("ASC ");
}
if (process_p == 1) {
target[tp++] = source[inputlen - 1] + 1;
if (debug_print) printf("A%02X ", target[tp - 1] - 1);
} else if (process_p == 2) {
target[tp++] = source[inputlen - 2] + 1;
target[tp++] = source[inputlen - 1] + 1;
if (debug_print) printf("A%02X A%02X ", target[tp - 2] - 1, target[tp - 1] - 1);
}
}
} else if (current_mode == DM_EDIFACT) {
if (debug_print) printf("EDI ");
if (symbols_left <= 2 && process_p <= symbols_left) { // Unlatch not required!
if (process_p == 1) {
target[tp++] = source[inputlen - 1] + 1;
if (debug_print) printf("A%02X ", target[tp - 1] - 1);
} else if (process_p == 2) {
target[tp++] = source[inputlen - 2] + 1;
target[tp++] = source[inputlen - 1] + 1;
if (debug_print) printf("A%02X A%02X ", target[tp - 2] - 1, target[tp - 1] - 1);
}
} else {
// Append edifact unlatch value (31) and empty buffer
if (process_p <= 3) {
process_buffer[process_p++] = 31;
}
(void) dm_edi_buffer_xfer(process_buffer, process_p, target, &tp, 1 /*empty*/, debug_print);
}
} else if (current_mode == DM_BASE256) {
if (symbols_left > 0) {
tp = dm_update_b256_field_length(target, tp, b256_start);
}
/* B.2.1 255-state randomising algorithm */
for (i = b256_start; i < tp; i++) {
int prn = ((149 * (i + 1)) % 255) + 1;
target[i] = (unsigned char) ((target[i] + prn) & 0xFF);
}
}
if (debug_print) {
printf("\nData (%d): ", tp);
for (i = 0; i < tp; i++)
printf("%d ", target[i]);
printf("\n");
}
*p_binlen = tp;
return 0;
}
#endif /* Z_DMATRIX_VARIANT_H */

View file

@ -346,7 +346,7 @@ static void test_escape_char_process(int index, int generate, int debug) {
char *comment;
};
struct item data[] = {
/* 0*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 26, "01 05 08 09 0A 0B 0C 0D 0E E7 72 1F B6 4D 45 5D 41 91 6B 29 2A E8 33 B4 2F 7A D2 AB C4 B1", 0, "" },
/* 0*/ { BARCODE_DATAMATRIX, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 26, "01 05 08 09 0A 0B 0C 0D 0E 1C 1E 1F EB 02 5D 81 21 0D 92 2E 3D FD B6 9A 37 2A CD 61 FB 95", 0, "" },
/* 1*/ { BARCODE_CODABLOCKF, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 101, "(45) 67 62 43 40 44 47 48 29 6A 67 62 0B 49 4A 4B 4C 18 6A 67 62 0C 4D 5B 5D 5E 62 6A 67", 0, "" },
/* 2*/ { BARCODE_CODE16K, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 70, "(20) 14 64 68 71 72 73 74 75 76 77 91 93 94 101 65 60 103 103 45 61", 0, "" },
/* 3*/ { BARCODE_DOTCODE, DATA_MODE, -1, "\\0\\E\\a\\b\\t\\n\\v\\f\\r\\e\\G\\R\\x81\\\\", 0, 28, "65 40 44 47 48 49 4A 4B 4C 4D 5B 5D 5E 6E 41 3C", 0, "" },

View file

@ -1807,32 +1807,32 @@ static void test_microqr_input(int index, int generate, int debug) {
/* 12*/ { UNICODE_MODE, -1, "", 0, "85 F8 00 EC 11 EC 11 EC 00", "B1 (Shift JIS) (same bytes as ~ ASCII above, so ambiguous)" },
/* 13*/ { UNICODE_MODE, -1, "", 0, "CB 67 C0 00 EC 11 EC 11 00", "K1 (Shift JIS)" },
/* 14*/ { DATA_MODE, -1, "\223\137", 0, "8A 4D 7C 00 EC 11 EC 11 00", "B2 (Shift JIS)" },
/* 15*/ { DATA_MODE, 200, "\223\137", 0, "CB 67 C0 00 EC 11 EC 11 00", "K1 (Shift JIS) (full multibyte)" },
/* 15*/ { DATA_MODE, ZINT_FULL_MULTIBYTE, "\223\137", 0, "CB 67 C0 00 EC 11 EC 11 00", "K1 (Shift JIS) (full multibyte)" },
/* 16*/ { DATA_MODE, -1, "", 0, "8F 9E 0A E4 00 EC 11 EC 00", "B3 (UTF-8)" },
/* 17*/ { UNICODE_MODE, -1, "", 0, "CE AA 80 00 EC 11 EC 11 00", "K1 (Shift JIS)" },
/* 18*/ { DATA_MODE, -1, "\344\252", 0, "8B 92 A8 00 EC 11 EC 11 00", "B2 (Shift JIS)" },
/* 19*/ { DATA_MODE, 200, "\344\252", 0, "CE AA 80 00 EC 11 EC 11 00", "K1 (Shift JIS) (full multibyte)" },
/* 19*/ { DATA_MODE, ZINT_FULL_MULTIBYTE, "\344\252", 0, "CE AA 80 00 EC 11 EC 11 00", "K1 (Shift JIS) (full multibyte)" },
/* 20*/ { DATA_MODE, -1, "", 0, "8F A2 32 5C 00 EC 11 EC 00", "B3 (UTF-8)" },
/* 21*/ { UNICODE_MODE, -1, "¥点", 0, "8D 72 4D 7C 00 EC 11 EC 00", "B3 (Shift JIS) (optimized from B1 K1)" },
/* 22*/ { DATA_MODE, -1, "\134\223\137", 0, "8D 72 4D 7C 00 EC 11 EC 00", "B3 (Shift JIS) (optimized from B1 K1)" },
/* 23*/ { DATA_MODE, -1, "¥点", 0, "97 0A 97 9E 0A E4 00 EC 00", "B5 (UTF-8)" },
/* 24*/ { UNICODE_MODE, -1, "点茗", 0, "D3 67 F5 54 00 EC 11 EC 00", "K2 (Shift JIS)" },
/* 25*/ { DATA_MODE, -1, "\223\137\344\252", 0, "92 4D 7F 92 A8 00 EC 11 00", "B4 (Shift JIS)" },
/* 26*/ { DATA_MODE, 200, "\223\137\344\252", 0, "D3 67 F5 54 00 EC 11 EC 00", "K2 (Shift JIS) (full multibyte)" },
/* 26*/ { DATA_MODE, ZINT_FULL_MULTIBYTE, "\223\137\344\252", 0, "D3 67 F5 54 00 EC 11 EC 00", "K2 (Shift JIS) (full multibyte)" },
/* 27*/ { DATA_MODE, -1, "点茗", 0, "9B 9E 0A E7 A2 32 5C 00 00", "B6 (UTF-8)" },
/* 28*/ { DATA_MODE, 200, "点茗", 0, "9B 9E 0A E7 A2 32 5C 00 00", "B6 (UTF-8)" },
/* 28*/ { DATA_MODE, ZINT_FULL_MULTIBYTE, "点茗", 0, "9B 9E 0A E7 A2 32 5C 00 00", "B6 (UTF-8)" },
/* 29*/ { UNICODE_MODE, -1, "点茗・", 0, "D3 67 F5 55 0D 28 00 EC 00", "K2 B1 (Shift JIS)" },
/* 30*/ { DATA_MODE, -1, "\223\137\344\252\245", 0, "96 4D 7F 92 AA 94 00 EC 00", "B5 (Shift JIS)" },
/* 31*/ { DATA_MODE, 200, "\223\137\344\252\245", 0, "D3 67 F5 55 0D 28 00 EC 00", "K2 B1 (Shift JIS) (full multibyte)" },
/* 31*/ { DATA_MODE, ZINT_FULL_MULTIBYTE, "\223\137\344\252\245", 0, "D3 67 F5 55 0D 28 00 EC 00", "K2 B1 (Shift JIS) (full multibyte)" },
/* 32*/ { DATA_MODE, -1, "点茗・", 0, "A7 9E 0A E7 A2 32 5F BE F6 94 00", "B9 (UTF-8)" },
/* 33*/ { UNICODE_MODE, -1, "¥点茗・", 0, "99 72 4D 7F 92 AA 94 00 00", "B6 (Shift JIS) (optimized from B1 K2 B1)" },
/* 34*/ { DATA_MODE, -1, "\134\223\137\344\252\245", 0, "99 72 4D 7F 92 AA 94 00 00", "B6 (Shift JIS) (optimized from B1 K2 B1)" },
/* 35*/ { DATA_MODE, -1, "¥点茗・", 0, "4B C2 A5 E7 82 B9 E8 8C 97 EF BD A5 00 00", "B11 (UTF-8)" },
/* 36*/ { DATA_MODE, -1, "ÁȁȁȁȂ¢", 0, "4C C3 81 C8 81 C8 81 C8 81 C8 82 C2 A2 00", "B12 (UTF-8)" },
/* 37*/ { DATA_MODE, -1, "ÁȁȁȁȁȂ¢", 0, "4E C3 81 C8 81 C8 81 C8 81 C8 81 C8 82 C2 A2 00", "B14 (UTF-8)" },
/* 38*/ { DATA_MODE, 200, "ÁȁȁȁȁȂ¢", 0, "41 C3 6C 08 80 44 02 20 11 00 88 0A 12 0D 10 00", "B1 K6 B1 (UTF-8) (full multibyte)" },
/* 38*/ { DATA_MODE, ZINT_FULL_MULTIBYTE, "ÁȁȁȁȁȂ¢", 0, "41 C3 6C 08 80 44 02 20 11 00 88 0A 12 0D 10 00", "B1 K6 B1 (UTF-8) (full multibyte)" },
/* 39*/ { UNICODE_MODE, -1, "áA", 0, "8B 85 04 00 EC 11 EC 11 00", "B2 (ISO 8859-1)" },
/* 40*/ { UNICODE_MODE, 200, "áA", 0, "CE 00 40 00 EC 11 EC 11 00", "K1 (ISO 8859-1) (full multibyte)" },
/* 40*/ { UNICODE_MODE, ZINT_FULL_MULTIBYTE, "áA", 0, "CE 00 40 00 EC 11 EC 11 00", "K1 (ISO 8859-1) (full multibyte)" },
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;
@ -1857,8 +1857,9 @@ static void test_microqr_input(int index, int generate, int debug) {
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) {
printf(" /*%3d*/ { %s, %d, \"%s\", %s, \"%s\", \"%s\" },\n",
i, testUtilInputModeName(data[i].input_mode), data[i].option_3, testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
printf(" /*%3d*/ { %s, %s, \"%s\", %s, \"%s\", \"%s\" },\n",
i, testUtilInputModeName(data[i].input_mode), testUtilOption3Name(data[i].option_3),
testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
testUtilErrorName(data[i].ret), symbol->errtxt, data[i].comment);
} else {
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);

View file

@ -388,6 +388,7 @@ const char *testUtilInputModeName(int input_mode) {
{ "GS1PARENS_MODE", GS1PARENS_MODE, 0x0010 },
{ "GS1NOCHECK_MODE", GS1NOCHECK_MODE, 0x0020 },
{ "HEIGHTPERROW_MODE", HEIGHTPERROW_MODE, 0x0040 },
{ "FAST_MODE", FAST_MODE, 0x0080 },
};
static const int data_size = ARRAY_SIZE(data);
int set, i;
@ -433,7 +434,7 @@ const char *testUtilOption3Name(int option_3) {
static char buffer[64];
const char *name = NULL;
unsigned int high_byte = option_3 == -1 ? 0 : (option_3 >> 8) & 0xFF;
const unsigned int high_byte = option_3 == -1 ? 0 : (option_3 >> 8) & 0xFF;
switch (option_3 & 0xFF) {
case DM_SQUARE:
@ -2758,8 +2759,8 @@ int testUtilBwipp(int index, const struct zint_symbol *symbol, int option_1, int
added_dmre = 1;
}
}
if (option_3 != DM_SQUARE && symbol->width != symbol->height) {
if (option_3 == DM_DMRE && !added_dmre) {
if ((option_3 & 0x7F) != DM_SQUARE && symbol->width != symbol->height) {
if ((option_3 & 0x7F) == DM_DMRE && !added_dmre) {
sprintf(bwipp_opts_buf + strlen(bwipp_opts_buf), "%sdmre", strlen(bwipp_opts_buf) ? " " : "");
//added_dmre = 1;
}

View file

@ -41,8 +41,7 @@
#define ZINT_DEBUG_TEST_KEEP_OUTFILE 64
#define ZINT_DEBUG_TEST_BWIPP 128
#define ZINT_DEBUG_TEST_PERFORMANCE 256
#define ZINT_DEBUG_TEST_MINIMIZE 512
#define ZINT_DEBUG_TEST_ZXINGCPP 1024
#define ZINT_DEBUG_TEST_ZXINGCPP 512
#ifdef _MSC_VER
#define testutil_popen(command, mode) _popen(command, mode)

View file

@ -5,7 +5,7 @@ set -e
function run_zxingcpp_test() {
echo -e "\n$1 -f $2"
backend/tests/$1 -f "$2" -d $(expr 1024 + 16 + 32) || exit 1
backend/tests/$1 -f "$2" -d $(expr 512 + 16 + 32) || exit 1
}
run_zxingcpp_test "test_2of5" "encode"

View file

@ -274,24 +274,25 @@ extern "C" {
#define COMPLIANT_HEIGHT 0x2000 /* Warn if height not compliant and use standard height (if any) as default */
/* Input data types (`symbol->input_mode`) */
#define DATA_MODE 0 /* Binary */
#define UNICODE_MODE 1 /* UTF-8 */
#define GS1_MODE 2 /* GS1 */
#define DATA_MODE 0 /* Binary */
#define UNICODE_MODE 1 /* UTF-8 */
#define GS1_MODE 2 /* GS1 */
/* The following may be OR-ed with above */
#define ESCAPE_MODE 0x0008 /* Process escape sequences */
#define GS1PARENS_MODE 0x0010 /* Process parentheses as GS1 AI delimiters (instead of square brackets) */
#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 FAST_MODE 0x0080 /* Use faster if less optimal encodation for symbologies that support it */
/* Data Matrix specific options (`symbol->option_3`) */
#define DM_SQUARE 100 /* Only consider square versions on automatic symbol size selection */
#define DM_DMRE 101 /* Consider DMRE versions on automatic symbol size selection */
#define DM_SQUARE 100 /* Only consider square versions on automatic symbol size selection */
#define DM_DMRE 101 /* Consider DMRE versions on automatic symbol size selection */
/* QR, Han Xin, Grid Matrix specific options (`symbol->option_3`) */
#define ZINT_FULL_MULTIBYTE 200 /* Enable Kanji/Hanzi compression for Latin-1 & binary data */
#define ZINT_FULL_MULTIBYTE 200 /* Enable Kanji/Hanzi compression for Latin-1 & binary data */
/* Ultracode specific option (`symbol->option_3`) */
#define ULTRA_COMPRESSION 128 /* Enable Ultracode compression (experimental) */
#define ULTRA_COMPRESSION 128 /* Enable Ultracode compression (experimental) */
/* Warning and error conditions (API return values) */
#define ZINT_WARN_INVALID_OPTION 2 /* Invalid option given but overridden by Zint */

View file

@ -34,6 +34,7 @@ HEADERS += ../backend/aztec.h \
../backend/common.h \
../backend/composite.h \
../backend/dmatrix.h \
../backend/dmatrix_trace.h \
../backend/eci.h \
../backend/eci_sb.h \
../backend/emf.h \

View file

@ -26,6 +26,7 @@ HEADERS += ../backend/aztec.h \
../backend/common.h \
../backend/composite.h \
../backend/dmatrix.h \
../backend/dmatrix_trace.h \
../backend/eci.h \
../backend/emf.h \
../backend/font.h \

View file

@ -857,6 +857,7 @@ namespace Zint {
}
arg_bool(cmd, "--compliantheight", hasCompliantHeight() && compliantHeight());
arg_data(cmd, longOptOnly ? "--data=" : "-d ", text(), win);
if (m_symbol == BARCODE_DATAMATRIX || m_symbol == BARCODE_HIBC_DM) {
@ -875,6 +876,7 @@ namespace Zint {
}
arg_bool(cmd, "--esc", inputMode() & ESCAPE_MODE);
arg_bool(cmd, "--fast", inputMode() & FAST_MODE);
if (fgColor() != Qt::black) {
arg_color(cmd, "--fg=", fgColor());

View file

@ -137,6 +137,8 @@
2021-11-19 GL
- Added -heightperrow option
- Added DBAR_EXPSTK, CODE16K, CODE49 -rows
2021-12-17 GL
- Added -fast option
*/
#if defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
@ -468,6 +470,7 @@ static const char help_message[] = "zint tcl(stub,obj) dll\n"
/* cli option --ecinos not supported */
" -eci number: ECI to use\n"
/* cli option --esc not supported */
" -fast bool: use fast encodation (Data Matrix)\n"
" -fg color: set foreground color as 6 or 8 hex rrggbbaa\n"
/* replaces cli options --binary and --gs1 */
" -format binary|unicode|gs1: input data format. Default:unicode\n"
@ -726,7 +729,7 @@ static int Encode(Tcl_Interp *interp, int objc,
static const char *optionList[] = {
"-addongap", "-barcode", "-bg", "-bind", "-bold", "-border", "-box",
"-cols", "-compliantheight", "-dmre", "-dotsize", "-dotty",
"-eci", "-fg", "-format", "-fullmultibyte",
"-eci", "-fast", "-fg", "-format", "-fullmultibyte",
"-gs1nocheck", "-gs1parens", "-gssep", "-guarddescent",
"-height", "-heightperrow", "-init", "-mask", "-mode",
"-nobackground", "-noquietzones", "-notext", "-primary", "-quietzones",
@ -737,7 +740,7 @@ static int Encode(Tcl_Interp *interp, int objc,
enum iOption {
iAddonGap, iBarcode, iBG, iBind, iBold, iBorder, iBox,
iCols, iCompliantHeight, iDMRE, iDotSize, iDotty,
iECI, iFG, iFormat, iFullMultiByte,
iECI, iFast, iFG, iFormat, iFullMultiByte,
iGS1NoCheck, iGS1Parens, iGSSep, iGuardDescent,
iHeight, iHeightPerRow, iInit, iMask, iMode,
iNoBackground, iNoQuietZones, iNoText, iPrimary, iQuietZones,
@ -766,6 +769,7 @@ static int Encode(Tcl_Interp *interp, int objc,
case iCompliantHeight:
case iDMRE:
case iDotty:
case iFast:
case iGS1NoCheck:
case iGS1Parens:
case iGSSep:
@ -899,6 +903,13 @@ static int Encode(Tcl_Interp *interp, int objc,
my_symbol->output_options &= ~BARCODE_DOTTY_MODE;
}
break;
case iFast:
if (intValue) {
my_symbol->input_mode |= FAST_MODE;
} else {
my_symbol->input_mode &= ~FAST_MODE;
}
break;
case iGS1NoCheck:
if (intValue) {
my_symbol->input_mode |= GS1NOCHECK_MODE;

View file

@ -1175,7 +1175,7 @@ structapp | Structured | Mark a symbol as part of a | count 0
warn_level | integer | Affects error/warning value | WARN_DEFAULT
| | returned by Zint API. |
text | unsigned | Human Readable Text, which | "" (empty)
| character | usually consists of in- |
| character | usually consists of in- | (output only)
| string | put data plus one more |
| | check digit. Uses UTF-8 |
| | formatting, with a |
@ -2500,6 +2500,9 @@ DMRE symbol sizes may be activated in automatic size mode using the option
GS1 data may be encoded using FNC1 (preferred) or GS as separator. Use the
option --gssep to change to GS or use the API output_options |= GS1_GS_SEPARATOR
For a near-optimal but slower encoding, the --compressenc option (API
option_3 |= DM_COMPRESSION) may be used.
Data Matrix supports Structured Append of up to 16 symbols and a numeric ID
(file identifications), which can be set by using the --structapp option (see
section 4.15) or the API structapp variable. The ID consists of 2 numbers ID1
@ -3132,9 +3135,9 @@ Value | EC Level | Amount of symbol holding error correction data
-----------------------------------------------------------------
Zint does not currently implement data compression by default, but this can
be initiated through the API by setting
be initiated using the `--compressenc` option or through the API by setting
symbol->option_3 = ULTRA_COMPRESSION;
symbol->option_3 |= ULTRA_COMPRESSION;
WARNING: Ultracode data compression is experimental and should not be used
in a production environment.

View file

@ -137,6 +137,7 @@ static void usage(void) {
" -e, --ecinos Display table of ECI character encodings\n"
" --eci=NUMBER Set the ECI (Extended Channel Interpretation) code\n"
" --esc Process escape characters in input data\n"
" --fast Use faster encodation (Data Matrix)\n"
" --fg=COLOUR Specify a foreground colour (in hex RGB/RGBA)\n"
" --filetype=TYPE Set output file type BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT\n"
" --fullmultibyte Use multibyte for binary/Latin (QR/Han Xin/Grid Matrix)\n"
@ -863,7 +864,7 @@ int main(int argc, char **argv) {
enum options {
OPT_ADDONGAP = 128, OPT_BATCH, OPT_BINARY, OPT_BG, OPT_BIND, OPT_BOLD, OPT_BORDER, OPT_BOX,
OPT_CMYK, OPT_COLS, OPT_COMPLIANTHEIGHT, OPT_DIRECT, OPT_DMRE, OPT_DOTSIZE, OPT_DOTTY, OPT_DUMP,
OPT_ECI, OPT_ESC, OPT_FG, OPT_FILETYPE, OPT_FONTSIZE, OPT_FULLMULTIBYTE,
OPT_ECI, OPT_ESC, OPT_FAST, OPT_FG, OPT_FILETYPE, OPT_FONTSIZE, OPT_FULLMULTIBYTE,
OPT_GS1, OPT_GS1NOCHECK, OPT_GS1PARENS, OPT_GSSEP, OPT_GUARDDESCENT,
OPT_HEIGHT, OPT_HEIGHTPERROW, OPT_INIT, OPT_MIRROR, OPT_MASK, OPT_MODE,
OPT_NOBACKGROUND, OPT_NOQUIETZONES, OPT_NOTEXT, OPT_PRIMARY, OPT_QUIETZONES,
@ -894,6 +895,7 @@ int main(int argc, char **argv) {
{"eci", 1, NULL, OPT_ECI},
{"ecinos", 0, NULL, 'e'},
{"esc", 0, NULL, OPT_ESC},
{"fast", 0, NULL, OPT_FAST},
{"fg", 1, 0, OPT_FG},
{"filetype", 1, NULL, OPT_FILETYPE},
{"fontsize", 1, NULL, OPT_FONTSIZE},
@ -1045,6 +1047,9 @@ int main(int argc, char **argv) {
case OPT_ESC:
my_symbol->input_mode |= ESCAPE_MODE;
break;
case OPT_FAST:
my_symbol->input_mode |= FAST_MODE;
break;
case OPT_FG:
strncpy(my_symbol->fgcolour, optarg, 9);
break;

View file

@ -185,6 +185,9 @@ static void arg_input_mode(char *cmd, int input_mode) {
if (input_mode & ESCAPE_MODE) {
sprintf(cmd + (int) strlen(cmd), "%s--esc", strlen(cmd) ? " " : "");
}
if (input_mode & FAST_MODE) {
sprintf(cmd + (int) strlen(cmd), "%s--fast", strlen(cmd) ? " " : "");
}
if (input_mode & GS1PARENS_MODE) {
sprintf(cmd + (int) strlen(cmd), "%s--gs1parens", strlen(cmd) ? " " : "");
}
@ -286,26 +289,28 @@ static void test_dump_args(int index, int debug) {
/* 17*/ { BARCODE_PDF417, "123", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 0, 0, -1, "FF 54 7A BC 3D 4F 1D 5C 0F E8 A4\nFF 54 7A 90 2F D3 1F AB 8F E8 A4\nFF 54 6A F8 3A BF 15 3C 0F E8 A4\nFF 54 57 9E 24 E7 1A F7 CF E8 A4\nFF 54 7A E7 3D 0D 9D 73 0F E8 A4\nFF 54 7D 70 B9 CB DF 5E CF E8 A4" },
/* 18*/ { BARCODE_DATAMATRIX, "ABC", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA 8\nB3 4\n8F 0\nB2 C\nA6 0\nBA C\nD6 0\nEB 4\nE2 8\nFF C" },
/* 19*/ { BARCODE_DATAMATRIX, "ABC", NULL, NULL, NULL, -1, READER_INIT, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A\nAC 7\n8A 4\nA0 3\nC2 2\nB5 1\n82 2\nBA 7\n8C C\nA0 5\n86 A\nFF F" },
/* 20*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJK", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA AA AA\nA6 ED A9 D1\nB2 FE 92 7E\n98 E7 C3 FF\nE8 D0 90 CC\nC7 EB 8D 63\nC5 48 D3 C4\nFF FF FF FF" },
/* 21*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJK", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 1, -1, "AA AA\nA6 FF\nB2 C0\n99 19\nA8 BA\n84 EF\nC0 9C\nE9 47\nE5 90\nB3 49\n91 36\nB3 7D\nD4 56\nF7 DD\nC5 62\nFF FF" },
/* 22*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA A8\nA6 94 A4\nB2 AD 98\n99 09 3C\nA9 E1 00\n86 80 F4\nC2 F5 68\nF5 D5 1C\nF2 68 70\nDA 7A 1C\nB7 FA 30\nA8 E0 F4\n91 74 D8\nD6 1D 74\nD2 31 08\nF1 E9 74\nC2 BF A8\nA6 8B 6C\n83 3D D8\nF9 ED CC\nAB 5A 58\nFF FF FC" },
/* 23*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 1, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA AA AA AA AA AA AA\nA6 D9 C8 0F 82 EB 81 97\nB2 BA A7 C8 F5 64 BD 2E\n99 2F EF 29 84 07 9F C7\nA8 84 99 C2 F2 1A 9F 44\n86 D5 D9 8B EF 41 BB 7F\n85 44 BF 28 F7 80 99 76\nFF FF FF FF FF FF FF FF" },
/* 24*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 1, -1, 0, -1, -1, NULL, -1, -1, 1, -1, "AA AA A8\nA6 94 A4\nB2 AD 98\n99 09 3C\nA9 E1 00\n86 80 F4\nC2 F5 68\nF5 D5 1C\nF2 68 70\nDA 7A 1C\nB7 FA 30\nA8 E0 F4\n91 74 D8\nD6 1D 74\nD2 31 08\nF1 E9 74\nC2 BF A8\nA6 8B 6C\n83 3D D8\nF9 ED CC\nAB 5A 58\nFF FF FC" },
/* 25*/ { BARCODE_DATAMATRIX, "[91]12[92]34", NULL, NULL, NULL, GS1_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nFA 9C\nBC 00\nD7 84\nED E0\nA4 E4\nA7 40\n9D 3C\nBF 50\nFA 24\nB1 68\nE5 04\n92 70\nFF FC" },
/* 26*/ { BARCODE_DATAMATRIX, "[91]12[92]34", NULL, NULL, NULL, GS1_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 27*/ { BARCODE_DATAMATRIX, "[9\\x31]12[92]34", NULL, NULL, NULL, GS1_MODE | ESCAPE_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 28*/ { BARCODE_DATAMATRIX, "(9\\x31)12(92)34", NULL, NULL, NULL, GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 29*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, "12345678+12", -1, -1, 0, -1, "DB BC D3 9C 44 E9 D2 2C 19 E7 A2 D8 A0 00 00 00\nDB 31 1C 9C C7 29 92 47 D9 E9 40 C8 A0 00 00 00\nDA 3B EB 10 AF 09 9A 18 9D 7D 82 E8 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" },
/* 30*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, 2, "12345678+12", -1, -1, 0, -1, "D3 A3 E9 DB F5 C9 DB 43 D9 CB 98 D2 20 00 00 00\nD3 25 0F 11 E4 49 D3 51 F1 AC FC D6 20 00 00 00\nD1 33 48 19 39 E9 93 18 49 D8 98 D7 20 00 00 00\nD1 A6 FC DA 1C 49 9B C5 05 E2 84 D7 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" },
/* 31*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 32*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, 0, 26, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 5B F8\n82 72 08\nBA DA E8\nBA 52 E8\nBA 2A E8\n82 0A 08\nFE AB F8\n00 D8 00\nEF F6 20\nB5 C2 28\n36 28 88\nFD 42 10\n62 2A C8\n00 95 70\nFE B7 38\n82 FD D8\nBA 97 00\nBA 43 60\nBA C8 C8\n82 C3 68\nFE EA F8" },
/* 33*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 0A 08\nBA A2 E8\nBA 0A E8\nBA 5A E8\n82 72 08\nFE AB F8\n00 A0 00\nEF AE 20\n75 B5 20\n82 F7 58\nF4 9D C8\n5E 17 28\n00 C2 20\nFE 88 80\n82 82 38\nBA EA A8\nBA 55 50\nBA D7 68\n82 BD D0\nFE B7 78" },
/* 34*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 35*/ { BARCODE_QRCODE, "\\x93\\x5F", NULL, NULL, NULL, DATA_MODE | ESCAPE_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 36*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, 2, -1, NULL, -1, 1, 0, -1, "FE 4B F8\n82 92 08\nBA 42 E8\nBA 92 E8\nBA 3A E8\n82 EA 08\nFE AB F8\n00 38 00\nFB CD 50\nA5 89 18\n0B 74 B8\nFC 81 A0\n92 34 B8\n00 DE 48\nFE AB 10\n82 5E 50\nBA C9 20\nBA C9 20\nBA F4 E0\n82 81 A0\nFE B4 E8" },
/* 37*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 AA\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\nAA 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" },
/* 38*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 3, -1, NULL, -1, -1, 0, -1, "FE 16 FE\n80 E2 02\nBE C2 FA\nA0 A0 0A\nAE F6 EA\nAE 98 EA\nAE BA EA\n00 E0 00\n15 83 AA\n44 7E AE\n92 9C 78\n25 BF 08\n47 4B 8C\n0D F9 74\nAB E7 50\n00 3A 00\nFE C2 EA\n02 22 EA\nFA DA EA\n0A 22 0A\nEA B2 FA\nEA 9A 02\nEA E8 FE" },
/* 39*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 4, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 AA\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\nAA 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" },
/* 20*/ { BARCODE_DATAMATRIX, "ABCDEFGH", NULL, NULL, NULL, FAST_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nA6 8C\nB2 F0\n98 B4\nB9 A8\nB8 CC\nF0 78\nA0 3C\n99 70\n85 1C\nDA B0\nE5 94\nA7 50\nFF FC" },
/* 21*/ { BARCODE_DATAMATRIX, "ABCDEFGH", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\n80 04\n82 60\nC5 24\n98 A8\nA3 9C\nCB B8\nAF DC\n86 58\nF6 44\nAC 18\n90 54\nCF 30\nFF FC" },
/* 22*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJK", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA AA AA\n80 09 F9 BD\n82 4A E2 58\nC5 CD C9 A5\nD8 5C A5 FC\nE0 35 88 69\nCC FC B3 E6\nFF FF FF FF" },
/* 23*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJK", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 1, -1, "AA AA\n80 25\n82 24\nC5 5D\n98 90\nA4 C7\nC8 A6\nB9 E9\n8E 02\nDE 91\nCD 6C\nA0 BB\n85 80\n98 2D\nE4 CA\nFF FF" },
/* 24*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA A8\nBA 5A 44\n8B 4D 28\nBF 77 64\n97 85 50\nBA D8 AC\nCD ED B8\nD4 B5 2C\nD1 A8 00\n81 FB 2C\nE4 75 78\n96 E8 2C\nF3 75 78\nEE 1D 04\nCA BA 98\nB1 8F B4\nA0 4F 00\nE4 A7 74\nF1 D3 90\nEF E1 BC\n91 10 38\nFF FF FC" },
/* 25*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 1, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA AA AA AA AA AA AA AA\nBA 03 BA 7D E5 31 B0 0D\n8B 6A 93 B6 E0 0A B8 3C\nBF 1D EA A7 EB ED A1 FB\n96 66 86 B6 C9 AE 92 40\nBF 65 E7 95 BC B7 FA E3\nCC 7C 90 CC D1 24 AB 5A\nFF FF FF FF FF FF FF FF" },
/* 26*/ { BARCODE_DATAMATRIX, "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF", NULL, NULL, NULL, -1, -1, 0, -1, 1, -1, 0, -1, -1, NULL, -1, -1, 1, -1, "AA AA A8\nBA 5A 44\n8B 4D 28\nBF 77 64\n97 85 50\nBA D8 AC\nCD ED B8\nD4 B5 2C\nD1 A8 00\n81 FB 2C\nE4 75 78\n96 E8 2C\nF3 75 78\nEE 1D 04\nCA BA 98\nB1 8F B4\nA0 4F 00\nE4 A7 74\nF1 D3 90\nEF E1 BC\n91 10 38\nFF FF FC" },
/* 27*/ { BARCODE_DATAMATRIX, "[91]12[92]34", NULL, NULL, NULL, GS1_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nFA 9C\nBC 00\nD7 84\nED E0\nA4 E4\nA7 40\n9D 3C\nBF 50\nFA 24\nB1 68\nE5 04\n92 70\nFF FC" },
/* 28*/ { BARCODE_DATAMATRIX, "[91]12[92]34", NULL, NULL, NULL, GS1_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 29*/ { BARCODE_DATAMATRIX, "[9\\x31]12[92]34", NULL, NULL, NULL, GS1_MODE | ESCAPE_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 30*/ { BARCODE_DATAMATRIX, "(9\\x31)12(92)34", NULL, NULL, NULL, GS1_MODE | ESCAPE_MODE | GS1PARENS_MODE, GS1_GS_SEPARATOR, 0, -1, 0, -1, 0, -1, -1, NULL, -1, -1, 0, -1, "AA A8\nF9 DC\nBF 20\nD6 C4\nED 10\nA0 0C\nA7 C0\n96 5C\nBA 70\nBB A4\nE2 18\nDD 14\n9C 40\nFF FC" },
/* 31*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, "12345678+12", -1, -1, 0, -1, "DB BC D3 9C 44 E9 D2 2C 19 E7 A2 D8 A0 00 00 00\nDB 31 1C 9C C7 29 92 47 D9 E9 40 C8 A0 00 00 00\nDA 3B EB 10 AF 09 9A 18 9D 7D 82 E8 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" },
/* 32*/ { BARCODE_EANX_CC, "[91]12", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, 2, "12345678+12", -1, -1, 0, -1, "D3 A3 E9 DB F5 C9 DB 43 D9 CB 98 D2 20 00 00 00\nD3 25 0F 11 E4 49 D3 51 F1 AC FC D6 20 00 00 00\nD1 33 48 19 39 E9 93 18 49 D8 98 D7 20 00 00 00\nD1 A6 FC DA 1C 49 9B C5 05 E2 84 D7 A0 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n20 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00\n10 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00\n14 68 D1 A6 49 BD 55 C9 D4 22 48 B9 40 59 94 98" },
/* 33*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 34*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, 0, 26, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 5B F8\n82 72 08\nBA DA E8\nBA 52 E8\nBA 2A E8\n82 0A 08\nFE AB F8\n00 D8 00\nEF F6 20\nB5 C2 28\n36 28 88\nFD 42 10\n62 2A C8\n00 95 70\nFE B7 38\n82 FD D8\nBA 97 00\nBA 43 60\nBA C8 C8\n82 C3 68\nFE EA F8" },
/* 35*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 0, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 0A 08\nBA A2 E8\nBA 0A E8\nBA 5A E8\n82 72 08\nFE AB F8\n00 A0 00\nEF AE 20\n75 B5 20\n82 F7 58\nF4 9D C8\n5E 17 28\n00 C2 20\nFE 88 80\n82 82 38\nBA EA A8\nBA 55 50\nBA D7 68\n82 BD D0\nFE B7 78" },
/* 36*/ { BARCODE_QRCODE, "\223\137", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 37*/ { BARCODE_QRCODE, "\\x93\\x5F", NULL, NULL, NULL, DATA_MODE | ESCAPE_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, 1, 0, -1, "FE 2B F8\n82 AA 08\nBA B2 E8\nBA 0A E8\nBA FA E8\n82 E2 08\nFE AB F8\n00 80 00\nD3 3B B0\n60 95 68\n7A B3 A0\n1D 0F 98\nAA D7 30\n00 E6 A8\nFE DA D0\n82 42 20\nBA 0E 38\nBA C7 18\nBA 17 68\n82 B9 40\nFE C5 28" },
/* 38*/ { BARCODE_QRCODE, "", NULL, NULL, NULL, -1, -1, 0, -1, 0, -1, 0, 2, -1, NULL, -1, 1, 0, -1, "FE 4B F8\n82 92 08\nBA 42 E8\nBA 92 E8\nBA 3A E8\n82 EA 08\nFE AB F8\n00 38 00\nFB CD 50\nA5 89 18\n0B 74 B8\nFC 81 A0\n92 34 B8\n00 DE 48\nFE AB 10\n82 5E 50\nBA C9 20\nBA C9 20\nBA F4 E0\n82 81 A0\nFE B4 E8" },
/* 39*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, -1, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 AA\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\nAA 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" },
/* 40*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 3, -1, NULL, -1, -1, 0, -1, "FE 16 FE\n80 E2 02\nBE C2 FA\nA0 A0 0A\nAE F6 EA\nAE 98 EA\nAE BA EA\n00 E0 00\n15 83 AA\n44 7E AE\n92 9C 78\n25 BF 08\n47 4B 8C\n0D F9 74\nAB E7 50\n00 3A 00\nFE C2 EA\n02 22 EA\nFA DA EA\n0A 22 0A\nEA B2 FA\nEA 9A 02\nEA E8 FE" },
/* 41*/ { BARCODE_HANXIN, "é", NULL, NULL, NULL, DATA_MODE, -1, 0, -1, 0, -1, 1, 4, -1, NULL, -1, -1, 0, -1, "FE 8A FE\n80 28 02\nBE E8 FA\nA0 94 0A\nAE 3E EA\nAE D2 EA\nAE 74 EA\n00 AA 00\n15 B4 AA\n0B 48 74\nA2 4A A4\nB5 56 2C\nA8 5A A8\n9F 18 50\nAA 07 50\n00 A6 00\nFE 20 EA\n02 C2 EA\nFA C4 EA\n0A 42 0A\nEA 52 FA\nEA 24 02\nEA AA FE" },
};
int data_size = ARRAY_SIZE(data);
int i;

View file

@ -50,242 +50,242 @@
</item>
<item>
<property name="text">
<string>10 x 10</string>
<string>10 x 10 (Zint 1)</string>
</property>
</item>
<item>
<property name="text">
<string>12 x 12</string>
<string>12 x 12 (Zint 2)</string>
</property>
</item>
<item>
<property name="text">
<string>14 x 14</string>
<string>14 x 14 (Zint 3)</string>
</property>
</item>
<item>
<property name="text">
<string>16 x 16</string>
<string>16 x 16 (Zint 4)</string>
</property>
</item>
<item>
<property name="text">
<string>18 x 18</string>
<string>18 x 18 (Zint 5)</string>
</property>
</item>
<item>
<property name="text">
<string>20 x 20</string>
<string>20 x 20 (Zint 6)</string>
</property>
</item>
<item>
<property name="text">
<string>22 x 22</string>
<string>22 x 22 (Zint 7)</string>
</property>
</item>
<item>
<property name="text">
<string>24 x 24</string>
<string>24 x 24 (Zint 8)</string>
</property>
</item>
<item>
<property name="text">
<string>26 x 26</string>
<string>26 x 26 (Zint 9)</string>
</property>
</item>
<item>
<property name="text">
<string>32 x 32</string>
<string>32 x 32 (Zint 10)</string>
</property>
</item>
<item>
<property name="text">
<string>36 x 36</string>
<string>36 x 36 (Zint 11)</string>
</property>
</item>
<item>
<property name="text">
<string>40 x 40</string>
<string>40 x 40 (Zint 12)</string>
</property>
</item>
<item>
<property name="text">
<string>44 x 44</string>
<string>44 x 44 (Zint 13)</string>
</property>
</item>
<item>
<property name="text">
<string>48 x 48</string>
<string>48 x 48 (Zint 14)</string>
</property>
</item>
<item>
<property name="text">
<string>52 x 52</string>
<string>52 x 52 (Zint 15)</string>
</property>
</item>
<item>
<property name="text">
<string>64 x 64</string>
<string>64 x 64 (Zint 16)</string>
</property>
</item>
<item>
<property name="text">
<string>72 x 72</string>
<string>72 x 72 (Zint 17)</string>
</property>
</item>
<item>
<property name="text">
<string>80 x 80</string>
<string>80 x 80 (Zint 18)</string>
</property>
</item>
<item>
<property name="text">
<string>88 x 88</string>
<string>88 x 88 (Zint 19)</string>
</property>
</item>
<item>
<property name="text">
<string>96 x 96</string>
<string>96 x 96 (Zint 20)</string>
</property>
</item>
<item>
<property name="text">
<string>104 x 104</string>
<string>104 x 104 (Zint 21)</string>
</property>
</item>
<item>
<property name="text">
<string>120 x 120</string>
<string>120 x 120 (Zint 22)</string>
</property>
</item>
<item>
<property name="text">
<string>132 x 132</string>
<string>132 x 132 (Zint 23)</string>
</property>
</item>
<item>
<property name="text">
<string>144 x 144</string>
<string>144 x 144 (Zint 24)</string>
</property>
</item>
<item>
<property name="text">
<string>8 x 18</string>
<string>8 x 18 (Zint 25)</string>
</property>
</item>
<item>
<property name="text">
<string>8 x 32</string>
<string>8 x 32 (Zint 26)</string>
</property>
</item>
<item>
<property name="text">
<string>12 x 26</string>
<string>12 x 26 (Zint 27)</string>
</property>
</item>
<item>
<property name="text">
<string>12 x 36</string>
<string>12 x 36 (Zint 28)</string>
</property>
</item>
<item>
<property name="text">
<string>16 x 36</string>
<string>16 x 36 (Zint 29)</string>
</property>
</item>
<item>
<property name="text">
<string>16 x 48</string>
<string>16 x 48 (Zint 30)</string>
</property>
</item>
<item>
<property name="text">
<string>8 x 48 (DMRE)</string>
<string>8 x 48 (DMRE) (Zint 31)</string>
</property>
</item>
<item>
<property name="text">
<string>8 x 64 (DMRE)</string>
<string>8 x 64 (DMRE) (Zint 32)</string>
</property>
</item>
<item>
<property name="text">
<string>8 x 80 (DMRE)</string>
<string>8 x 80 (DMRE) (Zint 33)</string>
</property>
</item>
<item>
<property name="text">
<string>8 x 96 (DMRE)</string>
<string>8 x 96 (DMRE) (Zint 34)</string>
</property>
</item>
<item>
<property name="text">
<string>8 x 120 (DMRE)</string>
<string>8 x 120 (DMRE) (Zint 35)</string>
</property>
</item>
<item>
<property name="text">
<string>8 x 144 (DMRE)</string>
<string>8 x 144 (DMRE) (Zint 36)</string>
</property>
</item>
<item>
<property name="text">
<string>12 x 64 (DMRE)</string>
<string>12 x 64 (DMRE) (Zint 37)</string>
</property>
</item>
<item>
<property name="text">
<string>12 x 88 (DMRE)</string>
<string>12 x 88 (DMRE) (Zint 38)</string>
</property>
</item>
<item>
<property name="text">
<string>16 x 64 (DMRE)</string>
<string>16 x 64 (DMRE) (Zint 39)</string>
</property>
</item>
<item>
<property name="text">
<string>20 x 36 (DMRE)</string>
<string>20 x 36 (DMRE) (Zint 40)</string>
</property>
</item>
<item>
<property name="text">
<string>20 x 44 (DMRE)</string>
<string>20 x 44 (DMRE) (Zint 41)</string>
</property>
</item>
<item>
<property name="text">
<string>20 x 64 (DMRE)</string>
<string>20 x 64 (DMRE) (Zint 42)</string>
</property>
</item>
<item>
<property name="text">
<string>22 x 48 (DMRE)</string>
<string>22 x 48 (DMRE) (Zint 43)</string>
</property>
</item>
<item>
<property name="text">
<string>24 x 48 (DMRE)</string>
<string>24 x 48 (DMRE) (Zint 44)</string>
</property>
</item>
<item>
<property name="text">
<string>24 x 64 (DMRE)</string>
<string>24 x 64 (DMRE) (Zint 45)</string>
</property>
</item>
<item>
<property name="text">
<string>26 x 40 (DMRE)</string>
<string>26 x 40 (DMRE) (Zint 46)</string>
</property>
</item>
<item>
<property name="text">
<string>26 x 48 (DMRE)</string>
<string>26 x 48 (DMRE) (Zint 47)</string>
</property>
</item>
<item>
<property name="text">
<string>26 x 64 (DMRE)</string>
<string>26 x 64 (DMRE) (Zint 48)</string>
</property>
</item>
</widget>
@ -407,6 +407,20 @@ instead of the preferred FNC1
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkDMFast">
<property name="text">
<string>&amp;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>
<widget class="QGroupBox" name="groupBoxDMStructApp">
<property name="title">

View file

@ -1233,6 +1233,7 @@ void MainWindow::change_options()
connect(get_widget(QSL("chkDMRectangle")), SIGNAL(toggled( bool )), SLOT(update_preview()));
connect(get_widget(QSL("chkDMRE")), SIGNAL(toggled( bool )), SLOT(update_preview()));
connect(get_widget(QSL("chkDMGSSep")), SIGNAL(toggled( bool )), SLOT(update_preview()));
connect(get_widget(QSL("chkDMFast")), SIGNAL(toggled( bool )), SLOT(update_preview()));
connect(get_widget(QSL("cmbDMStructAppCount")), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
connect(get_widget(QSL("cmbDMStructAppCount")), SIGNAL(currentIndexChanged( int )), SLOT(structapp_ui_set()));
connect(get_widget(QSL("cmbDMStructAppIndex")), SIGNAL(currentIndexChanged( int )), SLOT(update_preview()));
@ -2024,6 +2025,10 @@ void MainWindow::update_preview()
m_bc.bc.setOption3(0);
}
if (get_chk_val(QSL("chkDMFast"))) {
m_bc.bc.setInputMode(FAST_MODE | m_bc.bc.inputMode());
}
if ((item_val = get_cmb_index(QSL("cmbDMStructAppCount"))) != 0) {
QString id;
int id1 = get_spn_val(QSL("spnDMStructAppID"));
@ -2884,6 +2889,7 @@ void MainWindow::save_sub_settings(QSettings &settings, int symbology)
settings.setValue(QSL("studio/bc/datamatrix/chk_suppress_rect"), get_chk_val(QSL("chkDMRectangle")));
settings.setValue(QSL("studio/bc/datamatrix/chk_allow_dmre"), get_chk_val(QSL("chkDMRE")));
settings.setValue(QSL("studio/bc/datamatrix/chk_gs_sep"), get_chk_val(QSL("chkDMGSSep")));
settings.setValue(QSL("studio/bc/datamatrix/chk_fast"), get_chk_val(QSL("chkDMFast")));
settings.setValue(QSL("studio/bc/datamatrix/structapp_count"), get_cmb_index(QSL("cmbDMStructAppCount")));
settings.setValue(QSL("studio/bc/datamatrix/structapp_index"), get_cmb_index(QSL("cmbDMStructAppIndex")));
settings.setValue(QSL("studio/bc/datamatrix/structapp_id"), get_spn_val(QSL("spnDMStructAppID")));
@ -3259,6 +3265,7 @@ void MainWindow::load_sub_settings(QSettings &settings, int symbology)
set_chk_from_setting(settings, QSL("studio/bc/datamatrix/chk_suppress_rect"), QSL("chkDMRectangle"));
set_chk_from_setting(settings, QSL("studio/bc/datamatrix/chk_allow_dmre"), QSL("chkDMRE"));
set_chk_from_setting(settings, QSL("studio/bc/datamatrix/chk_gs_sep"), QSL("chkDMGSSep"));
set_chk_from_setting(settings, QSL("studio/bc/datamatrix/chk_fast"), QSL("chkDMFast"));
set_cmb_from_setting(settings, QSL("studio/bc/datamatrix/structapp_count"), QSL("cmbDMStructAppCount"));
set_cmb_from_setting(settings, QSL("studio/bc/datamatrix/structapp_index"), QSL("cmbDMStructAppIndex"));
set_spn_from_setting(settings, QSL("studio/bc/datamatrix/structapp_id"), QSL("spnDMStructAppID"), 1);

View file

@ -183,6 +183,7 @@
<ClInclude Include="..\backend\common.h" />
<ClInclude Include="..\backend\composite.h" />
<ClInclude Include="..\backend\dmatrix.h" />
<ClInclude Include="..\backend\dmatrix_trace.h" />
<ClInclude Include="..\backend\eci.h" />
<ClInclude Include="..\backend\eci_sb.h" />
<ClInclude Include="..\backend\emf.h" />

View file

@ -509,6 +509,10 @@
RelativePath="..\backend\dmatrix.h"
>
</File>
<File
RelativePath="..\backend\dmatrix_trace.h"
>
</File>
<File
RelativePath="..\backend\eci.h"
>

View file

@ -364,6 +364,7 @@
<ClInclude Include="..\..\backend\common.h" />
<ClInclude Include="..\..\backend\composite.h" />
<ClInclude Include="..\..\backend\dmatrix.h" />
<ClInclude Include="..\..\backend\dmatrix_trace.h" />
<ClInclude Include="..\..\backend\eci.h" />
<ClInclude Include="..\..\backend\eci_sb.h" />
<ClInclude Include="..\..\backend\emf.h" />

View file

@ -130,6 +130,7 @@
<ClInclude Include="..\..\backend\common.h" />
<ClInclude Include="..\..\backend\composite.h" />
<ClInclude Include="..\..\backend\dmatrix.h" />
<ClInclude Include="..\..\backend\dmatrix_trace.h" />
<ClInclude Include="..\..\backend\eci.h" />
<ClInclude Include="..\..\backend\eci_sb.h" />
<ClInclude Include="..\..\backend\emf.h" />

View file

@ -183,6 +183,7 @@
<ClInclude Include="..\..\backend\common.h" />
<ClInclude Include="..\..\backend\composite.h" />
<ClInclude Include="..\..\backend\dmatrix.h" />
<ClInclude Include="..\..\backend\dmatrix_trace.h" />
<ClInclude Include="..\..\backend\eci.h" />
<ClInclude Include="..\..\backend\eci_sb.h" />
<ClInclude Include="..\..\backend\emf.h" />