]> git.sur5r.net Git - glabels/blob - bc-backends/qrencode-3.1.0/qrencode_inner.h
Relocated barcode backends.
[glabels] / bc-backends / qrencode-3.1.0 / qrencode_inner.h
1 /**
2  * qrencode - QR Code encoder
3  *
4  * Header for test use
5  * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
6  *
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.
11  *
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.
16  *
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
20  */
21
22 #ifndef __QRENCODE_INNER_H__
23 #define __QRENCODE_INNER_H__
24
25 /**
26  * This header file includes definitions for test use.
27  */
28 extern BitStream *QRinput_mergeBitStream(QRinput *input);
29 extern BitStream *QRinput_getBitStream(QRinput *input);
30 extern int QRinput_estimateBitStreamSize(QRinput *input, int version);
31 extern int QRinput_splitEntry(QRinput_List *entry, int bytes);
32 extern int QRinput_lengthOfCode(QRencodeMode mode, int version, int bits);
33 extern int QRinput_insertStructuredAppendHeader(QRinput *input, int size, int index, unsigned char parity);
34
35
36 /******************************************************************************
37  * Raw code
38  *****************************************************************************/
39
40 typedef struct {
41         int dataLength;
42         unsigned char *data;
43         int eccLength;
44         unsigned char *ecc;
45 } RSblock;
46
47 typedef struct {
48         int version;
49         unsigned char *datacode;
50         unsigned char *ecccode;
51         int blocks;
52         RSblock *rsblock;
53         int count;
54         int dataLength;
55         int eccLength;
56         int b1;
57 } QRRawCode;
58
59 extern QRRawCode *QRraw_new(QRinput *input);
60 extern unsigned char QRraw_getCode(QRRawCode *raw);
61 extern void QRraw_free(QRRawCode *raw);
62
63 /******************************************************************************
64  * Frame filling
65  *****************************************************************************/
66 extern unsigned char *FrameFiller_fillerTest(int version);
67
68 /******************************************************************************
69  * QR-code encoding
70  *****************************************************************************/
71 extern QRcode *QRcode_encodeMask(QRinput *input, int mask);
72
73
74 /******************************************************************************
75  * Mask
76  *****************************************************************************/
77
78 extern int Mask_evaluateSymbol(int width, unsigned char *frame);
79 extern int Mask_writeFormatInformation(int width, unsigned char *frame, int mask, QRecLevel level);
80
81 #endif /* __QRENCODE_INNER_H__ */