TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
qrinput.h
Go to the documentation of this file.
1 /*
2  * qrencode - QR Code encoder
3  *
4  * Input data chunk class
5  * Copyright (C) 2006-2017 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 QRINPUT_H
23 #define QRINPUT_H
24 
25 #include "qrencode.h"
26 #include "bitstream.h"
27 
29 
30 /******************************************************************************
31  * Entry of input data
32  *****************************************************************************/
33 typedef struct _QRinput_List QRinput_List;
34 
35 struct _QRinput_List {
37  int size;
38  unsigned char *data;
41 };
42 
43 /******************************************************************************
44  * Input Data
45  *****************************************************************************/
46 struct _QRinput {
47  int version;
51  int mqr;
52  int fnc1;
53  unsigned char appid;
54 };
55 
56 /******************************************************************************
57  * Structured append input data
58  *****************************************************************************/
60 
64 };
65 
67  int size;
68  int parity;
71 };
72 
78 extern unsigned char *QRinput_getByteStream(QRinput *input);
79 
80 
81 extern int QRinput_estimateBitsModeNum(int size);
82 extern int QRinput_estimateBitsModeAn(int size);
83 extern int QRinput_estimateBitsMode8(int size);
84 extern int QRinput_estimateBitsModeKanji(int size);
85 
86 extern QRinput *QRinput_dup(QRinput *input);
87 
88 extern const signed char QRinput_anTable[128];
89 
95 #define QRinput_lookAnTable(__c__) \
96  ((__c__ & 0x80)?-1:QRinput_anTable[(int)__c__])
97 
102 #define MODE_INDICATOR_SIZE 4
103 
107 #define STRUCTURE_HEADER_SIZE 20
108 
112 #define MAX_STRUCTURED_SYMBOLS 16
113 
114 #ifdef WITH_TESTS
115 extern int QRinput_mergeBitStream(QRinput *input, BitStream *bstream);
116 extern int QRinput_getBitStream(QRinput *input, BitStream *bstream);
117 extern int QRinput_estimateBitStreamSize(QRinput *input, int version);
118 extern int QRinput_splitEntry(QRinput_List *entry, int bytes);
119 extern int QRinput_estimateVersion(QRinput *input);
120 extern int QRinput_lengthOfCode(QRencodeMode mode, int version, int bits);
121 extern int QRinput_insertStructuredAppendHeader(QRinput *input, int size, int index, unsigned char parity);
122 #endif
123 
124 #endif /* QRINPUT_H */
STATIC_IN_RELEASE int QRinput_estimateBitStreamSize(QRinput *input, int version)
Estimate the length of the encoded bit stream of the data.
Definition: qrinput.c:915
unsigned char * data
Data chunk.
Definition: qrinput.h:38
STATIC_IN_RELEASE int QRinput_insertStructuredAppendHeader(QRinput *input, int size, int number, unsigned char parity)
Insert a structured-append header to the head of the input data.
Definition: qrinput.c:246
const signed char QRinput_anTable[128]
Definition: qrinput.c:457
voidpf void uLong size
Definition: ioapi.h:136
int version
Definition: qrinput.h:47
int QRinput_isSplittableMode(QRencodeMode mode)
Definition: qrinput.c:37
QRecLevel level
Definition: qrinput.h:48
int size
number of structured symbols
Definition: qrinput.h:67
QRecLevel
Level of error correction.
Definition: qrencode.h:126
STATIC_IN_RELEASE int QRinput_mergeBitStream(QRinput *input, BitStream *bstream)
Merge all bit streams in the input data.
Definition: qrinput.c:1275
STATIC_IN_RELEASE int QRinput_getBitStream(QRinput *input, BitStream *bstream)
Merge all bit streams in the input data and append padding bits.
Definition: qrinput.c:1301
int QRinput_estimateBitsModeAn(int size)
Estimate the length of the encoded bit stream of alphabet-numeric data.
Definition: qrinput.c:491
int QRinput_estimateBitsMode8(int size)
Estimate the length of the encoded bit stream of 8 bit data.
Definition: qrinput.c:564
QRinput * QRinput_dup(QRinput *input)
Definition: qrinput.c:326
QRinput * input
Definition: qrinput.h:62
QRencodeMode
Encoding mode.
Definition: qrencode.h:111
QRinput_List * head
Definition: qrinput.h:49
QRencodeMode mode
Definition: qrinput.h:36
int size
Size of data chunk (byte).
Definition: qrinput.h:37
int QRinput_estimateBitsModeNum(int size)
Estimate the length of the encoded bit stream of numeric data.
Definition: qrinput.c:379
QRinput_InputList * head
Definition: qrinput.h:69
STATIC_IN_RELEASE int QRinput_estimateVersion(QRinput *input)
Estimate the required version number of the symbol.
Definition: qrinput.c:934
int mqr
Definition: qrinput.h:51
QRinput_List * tail
Definition: qrinput.h:50
unsigned char * QRinput_getByteStream(QRinput *input)
Pack all bit streams padding bits into a byte array.
Definition: qrinput.c:1324
STATIC_IN_RELEASE int QRinput_lengthOfCode(QRencodeMode mode, int version, int bits)
Return required length in bytes for specified mode, version and bits.
Definition: qrinput.c:959
QRinput_InputList * next
Definition: qrinput.h:63
BitStream * bstream
Definition: qrinput.h:39
int fnc1
Definition: qrinput.h:52
int QRinput_estimateBitsModeKanji(int size)
Estimate the length of the encoded bit stream of kanji data.
Definition: qrinput.c:614
QRinput_InputList * tail
Definition: qrinput.h:70
STATIC_IN_RELEASE int QRinput_splitEntry(QRinput_List *entry, int bytes)
Definition: qrinput.c:1461
const char int mode
Definition: ioapi.h:135
unsigned char appid
Definition: qrinput.h:53
QRinput_List * next
Definition: qrinput.h:40