62 w = mqrspecCapacity[version].
width - 1;
63 ecc = mqrspecCapacity[version].
ec[level];
64 if(ecc == 0)
return 0;
65 return w * w - 64 - ecc * 8;
75 return mqrspecCapacity[version].
ec[level];
80 return mqrspecCapacity[version].
width;
108 words = (1 << bits) - 1;
122 {0x4445, 0x55ae, 0x6793, 0x7678, 0x06de, 0x1735, 0x2508, 0x34e3},
123 {0x4172, 0x5099, 0x62a4, 0x734f, 0x03e9, 0x1202, 0x203f, 0x31d4},
124 {0x4e2b, 0x5fc0, 0x6dfd, 0x7c16, 0x0cb0, 0x1d5b, 0x2f66, 0x3e8d},
125 {0x4b1c, 0x5af7, 0x68ca, 0x7921, 0x0987, 0x186c, 0x2a51, 0x3bba}
141 if(mask < 0 || mask > 3)
return 0;
145 if(type < 0)
return 0;
162 static const unsigned char finder[] = {
163 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1,
164 0xc1, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1,
165 0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0, 0xc1,
166 0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0, 0xc1,
167 0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0, 0xc1,
168 0xc1, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1,
169 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1,
172 const unsigned char *s;
174 frame += oy * width + ox;
176 for(y = 0; y < 7; y++) {
177 for(x = 0; x < 7; x++) {
187 unsigned char *frame, *p, *q;
191 width = mqrspecCapacity[version].
width;
192 frame = (
unsigned char *)
malloc((
size_t)(width * width));
193 if(frame == NULL)
return NULL;
195 memset(frame, 0, (
size_t)(width * width));
200 for(y = 0; y < 7; y++) {
204 memset(frame + width * 7, 0xc0, 8);
206 memset(frame + width * 8 + 1, 0x84, 8);
207 p = frame + width + 8;
208 for(y = 0; y < 7; y++) {
214 q = frame + width * 8;
215 for(x = 1; x < width-7; x++) {
int width
Edge length of the symbol.
static unsigned char * MQRspec_createFrame(int version)
static const int lengthTableBits[4][4]
See Table 3 (pp.107) of Appendix 1, JIS X0510:2004.
static const unsigned int formatInfo[4][8]
int ec[4]
Number of ECC code (bytes)
QRecLevel
Level of error correction.
int MQRspec_lengthIndicator(QRencodeMode mode, int version)
Return the size of length indicator for the mode and version.
#define MQRSPEC_VERSION_MAX
Maximum version (size) of QR-code symbol.
static void putFinderPattern(unsigned char *frame, int width, int ox, int oy)
Put a finder pattern.
QRencodeMode
Encoding mode.
unsigned char * MQRspec_newFrame(int version)
Return a copy of initialized frame.
unsigned int MQRspec_getFormatInfo(int mask, int version, QRecLevel level)
Return BCH encoded format information pattern.
int MQRspec_getDataLengthBit(int version, QRecLevel level)
Return maximum data code length (bits) for the version.
int MQRspec_maximumWords(QRencodeMode mode, int version)
Return the maximum length for the mode and version.
static const MQRspec_Capacity mqrspecCapacity[MQRSPEC_VERSION_MAX+1]
Table of the capacity of symbols See Table 1 (pp.106) and Table 8 (pp.113) of Appendix 1...
int MQRspec_getECCLength(int version, QRecLevel level)
Return maximum error correction code length (bytes) for the version.
int MQRspec_getWidth(int version)
Return the width of the symbol for the version.
int MQRspec_getDataLength(int version, QRecLevel level)
Return maximum data code length (bytes) for the version.
static const int typeTable[MQRSPEC_VERSION_MAX+1][3]