TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
qrspec.h
Go to the documentation of this file.
1 /*
2  * qrencode - QR Code encoder
3  *
4  * QR Code specification in convenient format.
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 QRSPEC_H
23 #define QRSPEC_H
24 
25 #include "qrencode.h"
26 
27 /******************************************************************************
28  * Version and capacity
29  *****************************************************************************/
30 
34 #define QRSPEC_WIDTH_MAX 177
35 
42 extern int QRspec_getDataLength(int version, QRecLevel level);
43 
50 extern int QRspec_getECCLength(int version, QRecLevel level);
51 
58 extern int QRspec_getMinimumVersion(int size, QRecLevel level);
59 
65 extern int QRspec_getWidth(int version);
66 
72 extern int QRspec_getRemainder(int version);
73 
74 /******************************************************************************
75  * Length indicator
76  *****************************************************************************/
77 
84 extern int QRspec_lengthIndicator(QRencodeMode mode, int version);
85 
92 extern int QRspec_maximumWords(QRencodeMode mode, int version);
93 
94 /******************************************************************************
95  * Error correction code
96  *****************************************************************************/
97 
106 void QRspec_getEccSpec(int version, QRecLevel level, int spec[5]);
107 
108 #define QRspec_rsBlockNum(__spec__) (__spec__[0] + __spec__[3])
109 #define QRspec_rsBlockNum1(__spec__) (__spec__[0])
110 #define QRspec_rsDataCodes1(__spec__) (__spec__[1])
111 #define QRspec_rsEccCodes1(__spec__) (__spec__[2])
112 #define QRspec_rsBlockNum2(__spec__) (__spec__[3])
113 #define QRspec_rsDataCodes2(__spec__) (__spec__[4])
114 #define QRspec_rsEccCodes2(__spec__) (__spec__[2])
115 
116 #define QRspec_rsDataLength(__spec__) \
117  ((QRspec_rsBlockNum1(__spec__) * QRspec_rsDataCodes1(__spec__)) + \
118  (QRspec_rsBlockNum2(__spec__) * QRspec_rsDataCodes2(__spec__)))
119 #define QRspec_rsEccLength(__spec__) \
120  (QRspec_rsBlockNum(__spec__) * QRspec_rsEccCodes1(__spec__))
121 
122 /******************************************************************************
123  * Version information pattern
124  *****************************************************************************/
125 
132 extern unsigned int QRspec_getVersionPattern(int version);
133 
134 /******************************************************************************
135  * Format information
136  *****************************************************************************/
137 
144 extern unsigned int QRspec_getFormatInfo(int mask, QRecLevel level);
145 
146 /******************************************************************************
147  * Frame
148  *****************************************************************************/
149 
155 extern unsigned char *QRspec_newFrame(int version);
156 
157 /******************************************************************************
158  * Mode indicator
159  *****************************************************************************/
160 
164 #define QRSPEC_MODEID_ECI 7
165 #define QRSPEC_MODEID_NUM 1
166 #define QRSPEC_MODEID_AN 2
167 #define QRSPEC_MODEID_8 4
168 #define QRSPEC_MODEID_KANJI 8
169 #define QRSPEC_MODEID_FNC1FIRST 5
170 #define QRSPEC_MODEID_FNC1SECOND 9
171 #define QRSPEC_MODEID_STRUCTURE 3
172 #define QRSPEC_MODEID_TERMINATOR 0
173 
174 #endif /* QRSPEC_H */
int QRspec_getRemainder(int version)
Return the numer of remainder bits.
Definition: qrspec.c:124
voidpf void uLong size
Definition: ioapi.h:136
unsigned char * QRspec_newFrame(int version)
Return a copy of initialized frame.
Definition: qrspec.c:507
int QRspec_getMinimumVersion(int size, QRecLevel level)
Return a version number that satisfies the input code length.
Definition: qrspec.c:106
QRecLevel
Level of error correction.
Definition: qrencode.h:126
int QRspec_lengthIndicator(QRencodeMode mode, int version)
Return the size of length indicator for the mode and version.
Definition: qrspec.c:140
QRencodeMode
Encoding mode.
Definition: qrencode.h:111
int QRspec_maximumWords(QRencodeMode mode, int version)
Return the maximum length for the mode and version.
Definition: qrspec.c:156
unsigned int QRspec_getVersionPattern(int version)
Return BCH encoded version information pattern that is used for the symbol of version 7 or greater...
Definition: qrspec.c:362
unsigned int QRspec_getFormatInfo(int mask, QRecLevel level)
Return BCH encoded format information pattern.
Definition: qrspec.c:381
void QRspec_getEccSpec(int version, QRecLevel level, int spec[5])
Return an array of ECC specification.
Definition: qrspec.c:232
int QRspec_getWidth(int version)
Return the width of the symbol for the version.
Definition: qrspec.c:119
const char int mode
Definition: ioapi.h:135
int QRspec_getECCLength(int version, QRecLevel level)
Return maximum error correction code length (bytes) for the version.
Definition: qrspec.c:101
int QRspec_getDataLength(int version, QRecLevel level)
Return maximum data code length (bytes) for the version.
Definition: qrspec.c:96