2 * qrencode - QR Code encoder
4 * Input data chunk class
5 * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include "bitstream.h"
28 /******************************************************************************
30 *****************************************************************************/
31 typedef struct _QRinput_List QRinput_List;
33 struct _QRinput_List {
35 int size; ///< Size of data chunk (byte).
36 unsigned char *data; ///< Data chunk.
41 /******************************************************************************
43 *****************************************************************************/
51 /******************************************************************************
52 * Structured append input data
53 *****************************************************************************/
54 typedef struct _QRinput_InputList QRinput_InputList;
56 struct _QRinput_InputList {
58 QRinput_InputList *next;
61 struct _QRinput_Struct {
62 int size; ///< number of structured symbols
64 QRinput_InputList *head;
65 QRinput_InputList *tail;
69 * Pack all bit streams padding bits into a byte array.
70 * @param input input data.
71 * @return padded merged byte stream
73 extern unsigned char *QRinput_getByteStream(QRinput *input);
76 extern int QRinput_estimateBitsModeNum(int size);
77 extern int QRinput_estimateBitsModeAn(int size);
78 extern int QRinput_estimateBitsMode8(int size);
79 extern int QRinput_estimateBitsModeKanji(int size);
81 extern QRinput *QRinput_dup(QRinput *input);
83 extern const signed char QRinput_anTable[128];
86 * Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19).
87 * @param __c__ character
90 #define QRinput_lookAnTable(__c__) \
91 ((__c__ & 0x80)?-1:QRinput_anTable[(int)__c__])
94 * Length of a segment of structured-append header.
96 #define STRUCTURE_HEADER_BITS 20
99 * Maximum number of symbols in a set of structured-appended symbols.
101 #define MAX_STRUCTURED_SYMBOLS 16
103 #endif /* __QRINPUT_H__ */