/* zint.h - definitions for libzint
libzint - the open source barcode library
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
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 : */
#ifndef ZINT_H
#define ZINT_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
struct zint_vector_rect {
float x, y, height, width;
int colour;
struct zint_vector_rect *next;
};
struct zint_vector_string {
float x, y, fsize;
float width; /* Suggested string width, may be 0 if none recommended */
int length;
int rotation;
int halign; /* Horizontal alignment: 0 for centre (middle), 1 for left (start), 2 for right (end) */
unsigned char *text;
struct zint_vector_string *next; /* Pointer to next character */
};
struct zint_vector_circle {
float x, y, diameter;
int colour; /* Non-zero for draw with background colour */
struct zint_vector_circle *next; /* Pointer to next circle */
};
struct zint_vector_hexagon {
float x, y, diameter;
int rotation;
struct zint_vector_hexagon *next; /* Pointer to next hexagon */
};
struct zint_vector {
float width, height;
struct zint_vector_rect *rectangles; /* Pointer to first rectangle */
struct zint_vector_hexagon *hexagons; /* Pointer to first hexagon */
struct zint_vector_string *strings; /* Points to first string */
struct zint_vector_circle *circles; /* Points to first circle */
};
struct zint_symbol {
int symbology;
int height; /* Height in X-dims (ignored for fixed-width barcodes) */
int whitespace_width; /* Width in X-dims of whitespace to left/right of barcode */
int border_width; /* Size of border in X-dims */
int output_options;
char fgcolour[10]; /* Foreground as RGB/RGBA hexadecimal string */
char bgcolour[10]; /* Background as RGB/RGBA hexadecimal string */
char *fgcolor; /* Pointer to fgcolour */
char *bgcolor; /* Pointer to bgcolour */
char outfile[256];
float scale;
int option_1;
int option_2;
int option_3;
int show_hrt;
int fontsize;
int input_mode;
int eci;
unsigned char text[128]; /* UTF-8 */
int rows;
int width;
char primary[128];
unsigned char encoded_data[200][143];
int row_height[200]; /* Largest symbol is 189 x 189 Han Xin */
char errtxt[100];
unsigned char *bitmap;
int bitmap_width;
int bitmap_height;
unsigned char *alphamap;
unsigned int bitmap_byte_length;
float dot_size;
struct zint_vector *vector;
int debug;
int warn_level;
};
// Symbologies (symbology)
/* Tbarcode 7 codes */
#define BARCODE_CODE11 1
#define BARCODE_C25STANDARD 2
#define BARCODE_C25MATRIX 2 // Legacy
#define BARCODE_C25INTER 3
#define BARCODE_C25IATA 4
#define BARCODE_C25LOGIC 6
#define BARCODE_C25IND 7
#define BARCODE_CODE39 8
#define BARCODE_EXCODE39 9
#define BARCODE_EANX 13
#define BARCODE_EANX_CHK 14
#define BARCODE_GS1_128 16
#define BARCODE_EAN128 16 // Legacy
#define BARCODE_CODABAR 18
#define BARCODE_CODE128 20
#define BARCODE_DPLEIT 21
#define BARCODE_DPIDENT 22
#define BARCODE_CODE16K 23
#define BARCODE_CODE49 24
#define BARCODE_CODE93 25
#define BARCODE_FLAT 28
#define BARCODE_DBAR_OMN 29
#define BARCODE_RSS14 29 // Legacy
#define BARCODE_DBAR_LTD 30
#define BARCODE_RSS_LTD 30 // Legacy
#define BARCODE_DBAR_EXP 31
#define BARCODE_RSS_EXP 31 // Legacy
#define BARCODE_TELEPEN 32
#define BARCODE_UPCA 34
#define BARCODE_UPCA_CHK 35
#define BARCODE_UPCE 37
#define BARCODE_UPCE_CHK 38
#define BARCODE_POSTNET 40
#define BARCODE_MSI_PLESSEY 47
#define BARCODE_FIM 49
#define BARCODE_LOGMARS 50
#define BARCODE_PHARMA 51
#define BARCODE_PZN 52
#define BARCODE_PHARMA_TWO 53
#define BARCODE_PDF417 55
#define BARCODE_PDF417COMP 56
#define BARCODE_PDF417TRUNC 56 // Legacy
#define BARCODE_MAXICODE 57
#define BARCODE_QRCODE 58
#define BARCODE_CODE128B 60
#define BARCODE_AUSPOST 63
#define BARCODE_AUSREPLY 66
#define BARCODE_AUSROUTE 67
#define BARCODE_AUSREDIRECT 68
#define BARCODE_ISBNX 69
#define BARCODE_RM4SCC 70
#define BARCODE_DATAMATRIX 71
#define BARCODE_EAN14 72
#define BARCODE_VIN 73
#define BARCODE_CODABLOCKF 74
#define BARCODE_NVE18 75
#define BARCODE_JAPANPOST 76
#define BARCODE_KOREAPOST 77
#define BARCODE_DBAR_STK 79
#define BARCODE_RSS14STACK 79 // Legacy
#define BARCODE_DBAR_OMNSTK 80
#define BARCODE_RSS14STACK_OMNI 80 // Legacy
#define BARCODE_DBAR_EXPSTK 81
#define BARCODE_RSS_EXPSTACK 81 // Legacy
#define BARCODE_PLANET 82
#define BARCODE_MICROPDF417 84
#define BARCODE_USPS_IMAIL 85
#define BARCODE_ONECODE 85 // Legacy
#define BARCODE_PLESSEY 86
/* Tbarcode 8 codes */
#define BARCODE_TELEPEN_NUM 87
#define BARCODE_ITF14 89
#define BARCODE_KIX 90
#define BARCODE_AZTEC 92
#define BARCODE_DAFT 93
#define BARCODE_DPD 96
#define BARCODE_MICROQR 97
/* Tbarcode 9 codes */
#define BARCODE_HIBC_128 98
#define BARCODE_HIBC_39 99
#define BARCODE_HIBC_DM 102
#define BARCODE_HIBC_QR 104
#define BARCODE_HIBC_PDF 106
#define BARCODE_HIBC_MICPDF 108
#define BARCODE_HIBC_BLOCKF 110
#define BARCODE_HIBC_AZTEC 112
/* Tbarcode 10 codes */
#define BARCODE_DOTCODE 115
#define BARCODE_HANXIN 116
/*Tbarcode 11 codes*/
#define BARCODE_MAILMARK 121
/* Zint specific */
#define BARCODE_AZRUNE 128
#define BARCODE_CODE32 129
#define BARCODE_EANX_CC 130
#define BARCODE_GS1_128_CC 131
#define BARCODE_EAN128_CC 131 // Legacy
#define BARCODE_DBAR_OMN_CC 132
#define BARCODE_RSS14_CC 132 // Legacy
#define BARCODE_DBAR_LTD_CC 133
#define BARCODE_RSS_LTD