blob: 3c40d0622a48ca54f20cda13107864d112d52b08 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/**
2 * qrencode - QR Code encoder
3 *
4 * Header for test use
5 * Copyright (C) 2006-2011 Kentaro Fukuchi <kentaro@fukuchi.org>
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
29/******************************************************************************
30 * Raw code
31 *****************************************************************************/
32
33typedef struct {
34 int dataLength;
35 unsigned char *data;
36 int eccLength;
37 unsigned char *ecc;
38} RSblock;
39
40typedef struct {
41 int version;
42 int dataLength;
43 int eccLength;
44 unsigned char *datacode;
45 unsigned char *ecccode;
46 int b1;
47 int blocks;
48 RSblock *rsblock;
49 int count;
50} QRRawCode;
51
52extern QRRawCode *QRraw_new(QRinput *input);
53extern unsigned char QRraw_getCode(QRRawCode *raw);
54extern void QRraw_free(QRRawCode *raw);
55
56/******************************************************************************
57 * Raw code for Micro QR Code
58 *****************************************************************************/
59
60typedef struct {
61 int version;
62 int dataLength;
63 int eccLength;
64 unsigned char *datacode;
65 unsigned char *ecccode;
66 RSblock *rsblock;
67 int oddbits;
68 int count;
69} MQRRawCode;
70
71extern MQRRawCode *MQRraw_new(QRinput *input);
72extern unsigned char MQRraw_getCode(MQRRawCode *raw);
73extern void MQRraw_free(MQRRawCode *raw);
74
75/******************************************************************************
76 * Frame filling
77 *****************************************************************************/
78extern unsigned char *FrameFiller_test(int version);
79extern unsigned char *FrameFiller_testMQR(int version);
80
81/******************************************************************************
82 * QR-code encoding
83 *****************************************************************************/
84extern QRcode *QRcode_encodeMask(QRinput *input, int mask);
85extern QRcode *QRcode_encodeMaskMQR(QRinput *input, int mask);
86extern QRcode *QRcode_new(int version, int width, unsigned char *data);
87
88#endif /* __QRENCODE_INNER_H__ */