qrencode  4.1.1
About: libqrencode is a fast and compact library and command-line utility for encoding data in a QR Code symbol.
  Fossies Dox: qrencode-4.1.1.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mqrspec.h File Reference
#include "qrencode.h"
Include dependency graph for mqrspec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MQRSPEC_WIDTH_MAX   17
 Version and capacity. More...
 
#define MQRSPEC_MODEID_NUM   0
 Mode indicator. More...
 
#define MQRSPEC_MODEID_AN   1
 
#define MQRSPEC_MODEID_8   2
 
#define MQRSPEC_MODEID_KANJI   3
 

Functions

int MQRspec_getDataLengthBit (int version, QRecLevel level)
 Return maximum data code length (bits) for the version. More...
 
int MQRspec_getDataLength (int version, QRecLevel level)
 Return maximum data code length (bytes) for the version. More...
 
int MQRspec_getECCLength (int version, QRecLevel level)
 Return maximum error correction code length (bytes) for the version. More...
 
int MQRspec_getMinimumVersion (int size, QRecLevel level)
 Return a version number that satisfies the input code length. More...
 
int MQRspec_getWidth (int version)
 Return the width of the symbol for the version. More...
 
int MQRspec_getRemainder (int version)
 Return the numer of remainder bits. More...
 
int MQRspec_lengthIndicator (QRencodeMode mode, int version)
 Length indicator. More...
 
int MQRspec_maximumWords (QRencodeMode mode, int version)
 Return the maximum length for the mode and version. More...
 
unsigned int MQRspec_getVersionPattern (int version)
 Version information pattern. More...
 
unsigned int MQRspec_getFormatInfo (int mask, int version, QRecLevel level)
 Format information. More...
 
unsigned char * MQRspec_newFrame (int version)
 Frame. More...
 

Macro Definition Documentation

◆ MQRSPEC_MODEID_8

#define MQRSPEC_MODEID_8   2

Definition at line 147 of file mqrspec.h.

◆ MQRSPEC_MODEID_AN

#define MQRSPEC_MODEID_AN   1

Definition at line 146 of file mqrspec.h.

◆ MQRSPEC_MODEID_KANJI

#define MQRSPEC_MODEID_KANJI   3

Definition at line 148 of file mqrspec.h.

◆ MQRSPEC_MODEID_NUM

#define MQRSPEC_MODEID_NUM   0

Mode indicator.

Mode indicator. See Table 2 in Appendix 1 of JIS X0510:2004, pp.107.

Definition at line 145 of file mqrspec.h.

◆ MQRSPEC_WIDTH_MAX

#define MQRSPEC_WIDTH_MAX   17

Version and capacity.

Maximum width of a symbol

Definition at line 34 of file mqrspec.h.

Function Documentation

◆ MQRspec_getDataLength()

int MQRspec_getDataLength ( int  version,
QRecLevel  level 
)

Return maximum data code length (bytes) for the version.

Parameters
versionversion of the symbol
levelerror correction level
Returns
maximum size (bytes)

Definition at line 70 of file mqrspec.c.

References level, MQRspec_getDataLengthBit(), and version.

Referenced by MQRraw_new().

◆ MQRspec_getDataLengthBit()

int MQRspec_getDataLengthBit ( int  version,
QRecLevel  level 
)

Return maximum data code length (bits) for the version.

Parameters
versionversion of the symbol
levelerror correction level
Returns
maximum size (bits)

Definition at line 59 of file mqrspec.c.

References MQRspec_Capacity::ec, level, mqrspecCapacity, version, and MQRspec_Capacity::width.

Referenced by MQRraw_new(), MQRspec_getDataLength(), and QRinput_appendPaddingBitMQR().

◆ MQRspec_getECCLength()

int MQRspec_getECCLength ( int  version,
QRecLevel  level 
)

Return maximum error correction code length (bytes) for the version.

Parameters
versionversion of the symbol
levelerror correction level
Returns
ECC size (bytes)

Definition at line 75 of file mqrspec.c.

References MQRspec_Capacity::ec, level, mqrspecCapacity, and version.

Referenced by MQRraw_new(), QRinput_newMQR(), and QRinput_setVersionAndErrorCorrectionLevel().

◆ MQRspec_getFormatInfo()

unsigned int MQRspec_getFormatInfo ( int  mask,
int  version,
QRecLevel  level 
)

Format information.

Return BCH encoded format information pattern.

Parameters
maskmask number
versionversion of the symbol
levelerror correction level
Returns
BCH encoded format information pattern

Definition at line 139 of file mqrspec.c.

References formatInfo, level, MQRSPEC_VERSION_MAX, QR_ECLEVEL_H, typeTable, and version.

Referenced by MMask_writeFormatInformation().

◆ MQRspec_getMinimumVersion()

int MQRspec_getMinimumVersion ( int  size,
QRecLevel  level 
)

Return a version number that satisfies the input code length.

Parameters
sizeinput code length (byte)
levelerror correction level
Returns
version number

◆ MQRspec_getRemainder()

int MQRspec_getRemainder ( int  version)

Return the numer of remainder bits.

Parameters
versionversion of the symbol
Returns
number of remainder bits

◆ MQRspec_getVersionPattern()

unsigned int MQRspec_getVersionPattern ( int  version)

Version information pattern.

Return BCH encoded version information pattern that is used for the symbol of version 7 or greater. Use lower 18 bits.

Parameters
versionvesion of the symbol
Returns
BCH encoded version information pattern

◆ MQRspec_getWidth()

int MQRspec_getWidth ( int  version)

Return the width of the symbol for the version.

Parameters
versionversion of the symbol
Returns
width

Definition at line 80 of file mqrspec.c.

References mqrspecCapacity, version, and MQRspec_Capacity::width.

Referenced by MMask_makeMask(), MMask_mask(), and QRcode_encodeMaskMQR().

◆ MQRspec_lengthIndicator()

int MQRspec_lengthIndicator ( QRencodeMode  mode,
int  version 
)

Length indicator.

Return the size of length indicator for the mode and version.

Parameters
modeencode mode
versionvesion of the symbol
Returns
the size of the appropriate length indicator (bits).

Definition at line 99 of file mqrspec.c.

References lengthTableBits, and version.

Referenced by QRinput_encodeMode8(), QRinput_encodeModeAn(), QRinput_encodeModeKanji(), QRinput_encodeModeNum(), and QRinput_estimateBitStreamSizeOfEntry().

◆ MQRspec_maximumWords()

int MQRspec_maximumWords ( QRencodeMode  mode,
int  version 
)

Return the maximum length for the mode and version.

Parameters
modeencode mode
versionvesion of the symbol
Returns
the maximum length (bytes)

Definition at line 104 of file mqrspec.c.

References lengthTableBits, QR_MODE_KANJI, and version.

Referenced by QRinput_encodeBitStream().

◆ MQRspec_newFrame()

unsigned char * MQRspec_newFrame ( int  version)

Frame.

Return a copy of initialized frame.

Parameters
versionversion of the symbol
Returns
Array of unsigned char. You can free it by free().

Definition at line 227 of file mqrspec.c.

References MQRspec_createFrame(), MQRSPEC_VERSION_MAX, and version.

Referenced by QRcode_encodeMaskMQR().