BPS C++ API  2.24.4
BpsQrCode Class Reference

Encoder for QR code. More...

#include <bpsqrcode.h>

Public Types

enum  Level { LevelL = 0 , LevelM = 1 , LevelQ = 2 , LevelH = 3 }
 Error correction levels. More...
 

Public Member Functions

 BpsQrCode ()
 Default constructor.
 
QVector< QVector< bool > > encode (const QString &aText, int aVersion, Level aLevel, bool aGS1)
 Encode a text into a matrix. More...
 

Detailed Description

Encoder for QR code.

Encoding happens according to ISO/IEC 18004 international standard for QR Code 2005.

Unsupported Features:

  • Kanji mode
  • Extended Channel Interpretation (ECI)
  • Structured Append
  • Micro QR

GS1 QR Code is supported where a FNC1 mode is added as first data element. ASCII GS (hex 1D) may be used as terminator for variable application data fields.

Member Enumeration Documentation

◆ Level

Error correction levels.

Enumerator
LevelL 

Low: up to 7% error correction.

LevelM 

Medium: up to 15% error correction.

LevelQ 

Quality: up to 25% error correction. This is the initial default.

LevelH 

High: up to 30% error correction.

Member Function Documentation

◆ encode()

QVector<QVector<bool> > BpsQrCode::encode ( const QString aText,
int  aVersion,
Level  aLevel,
bool  aGS1 
)

Encode a text into a matrix.

In case of error a empty matrix is returned. Possible errors are invalid version, or text too large to be encoded.

Parameters
aTextThe text to encode.
aVersionThe QR code version (1...40) to use, or 0 to automatically use the smallest possible version for the given text and error correction level.
aLevelThe error correction level to use.
aGS1True to create GS1 QR Code, false to create generic QR Code.
Returns
The encoded text in a bit matrix (2 dimensional array).

The documentation for this class was generated from the following file: