BigBlueBox
An Inventory Management System for a NYLT Course or other Boy Scout Programs
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
qrcodegen::QrCode Class Referencefinal

#include <QrCode.h>

Collaboration diagram for qrcodegen::QrCode:
Collaboration graph
[legend]

Classes

class  Ecc
 
class  ReedSolomonGenerator
 

Public Member Functions

 QrCode (int ver, Ecc ecl, const std::vector< std::uint8_t > &dataCodewords, int mask)
 
int getVersion () const
 
int getSize () const
 
Ecc getErrorCorrectionLevel () const
 
int getMask () const
 
bool getModule (int x, int y) const
 
std::string toSvgString (int border) const
 

Static Public Member Functions

static QrCode encodeText (const char *text, Ecc ecl)
 
static QrCode encodeBinary (const std::vector< std::uint8_t > &data, Ecc ecl)
 
static QrCode encodeSegments (const std::vector< QrSegment > &segs, Ecc ecl, int minVersion=1, int maxVersion=40, int mask=-1, bool boostEcl=true)
 

Static Public Attributes

static constexpr int MIN_VERSION = 1
 
static constexpr int MAX_VERSION = 40
 

Private Member Functions

void drawFunctionPatterns ()
 
void drawFormatBits (int mask)
 
void drawVersion ()
 
void drawFinderPattern (int x, int y)
 
void drawAlignmentPattern (int x, int y)
 
void setFunctionModule (int x, int y, bool isBlack)
 
bool module (int x, int y) const
 
std::vector< std::uint8_t > appendErrorCorrection (const std::vector< std::uint8_t > &data) const
 
void drawCodewords (const std::vector< std::uint8_t > &data)
 
void applyMask (int mask)
 
int handleConstructorMasking (int mask)
 
long getPenaltyScore () const
 

Static Private Member Functions

static std::vector< int > getAlignmentPatternPositions (int ver)
 
static int getNumRawDataModules (int ver)
 
static int getNumDataCodewords (int ver, Ecc ecl)
 

Private Attributes

int version
 
int size
 
Ecc errorCorrectionLevel
 
int mask
 
std::vector< std::vector< bool > > modules
 
std::vector< std::vector< bool > > isFunction
 

Static Private Attributes

static const int PENALTY_N1 = 3
 
static const int PENALTY_N2 = 3
 
static const int PENALTY_N3 = 40
 
static const int PENALTY_N4 = 10
 
static const std::int8_t ECC_CODEWORDS_PER_BLOCK [4][41]
 
static const std::int8_t NUM_ERROR_CORRECTION_BLOCKS [4][41]
 

Constructor & Destructor Documentation

qrcodegen::QrCode::QrCode ( int  ver,
Ecc  ecl,
const std::vector< std::uint8_t > &  dataCodewords,
int  mask 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

vector< uint8_t > qrcodegen::QrCode::appendErrorCorrection ( const std::vector< std::uint8_t > &  data) const
private

Here is the call graph for this function:

Here is the caller graph for this function:

void qrcodegen::QrCode::applyMask ( int  mask)
private

Here is the caller graph for this function:

void qrcodegen::QrCode::drawAlignmentPattern ( int  x,
int  y 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void qrcodegen::QrCode::drawCodewords ( const std::vector< std::uint8_t > &  data)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void qrcodegen::QrCode::drawFinderPattern ( int  x,
int  y 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void qrcodegen::QrCode::drawFormatBits ( int  mask)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void qrcodegen::QrCode::drawFunctionPatterns ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

void qrcodegen::QrCode::drawVersion ( )
private

Here is the call graph for this function:

Here is the caller graph for this function:

QrCode qrcodegen::QrCode::encodeBinary ( const std::vector< std::uint8_t > &  data,
Ecc  ecl 
)
static

Here is the call graph for this function:

QrCode qrcodegen::QrCode::encodeSegments ( const std::vector< QrSegment > &  segs,
Ecc  ecl,
int  minVersion = 1,
int  maxVersion = 40,
int  mask = -1,
bool  boostEcl = true 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

QrCode qrcodegen::QrCode::encodeText ( const char *  text,
Ecc  ecl 
)
static

Here is the call graph for this function:

vector< int > qrcodegen::QrCode::getAlignmentPatternPositions ( int  ver)
staticprivate

Here is the caller graph for this function:

QrCode::Ecc qrcodegen::QrCode::getErrorCorrectionLevel ( ) const
int qrcodegen::QrCode::getMask ( ) const
bool qrcodegen::QrCode::getModule ( int  x,
int  y 
) const

Here is the call graph for this function:

Here is the caller graph for this function:

int qrcodegen::QrCode::getNumDataCodewords ( int  ver,
Ecc  ecl 
)
staticprivate

Here is the call graph for this function:

Here is the caller graph for this function:

int qrcodegen::QrCode::getNumRawDataModules ( int  ver)
staticprivate

Here is the caller graph for this function:

long qrcodegen::QrCode::getPenaltyScore ( ) const
private

Here is the call graph for this function:

Here is the caller graph for this function:

int qrcodegen::QrCode::getSize ( ) const

Here is the caller graph for this function:

int qrcodegen::QrCode::getVersion ( ) const

Here is the caller graph for this function:

int qrcodegen::QrCode::handleConstructorMasking ( int  mask)
private

Here is the call graph for this function:

Here is the caller graph for this function:

bool qrcodegen::QrCode::module ( int  x,
int  y 
) const
private

Here is the caller graph for this function:

void qrcodegen::QrCode::setFunctionModule ( int  x,
int  y,
bool  isBlack 
)
private

Here is the caller graph for this function:

std::string qrcodegen::QrCode::toSvgString ( int  border) const

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const int8_t qrcodegen::QrCode::ECC_CODEWORDS_PER_BLOCK
staticprivate
Initial value:
= {
{-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30},
{-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28},
{-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30},
{-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30},
}
Ecc qrcodegen::QrCode::errorCorrectionLevel
private
std::vector<std::vector<bool> > qrcodegen::QrCode::isFunction
private
int qrcodegen::QrCode::mask
private
constexpr int qrcodegen::QrCode::MAX_VERSION = 40
static
constexpr int qrcodegen::QrCode::MIN_VERSION = 1
static
std::vector<std::vector<bool> > qrcodegen::QrCode::modules
private
const int8_t qrcodegen::QrCode::NUM_ERROR_CORRECTION_BLOCKS
staticprivate
Initial value:
= {
{-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25},
{-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49},
{-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68},
{-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81},
}
const int qrcodegen::QrCode::PENALTY_N1 = 3
staticprivate
const int qrcodegen::QrCode::PENALTY_N2 = 3
staticprivate
const int qrcodegen::QrCode::PENALTY_N3 = 40
staticprivate
const int qrcodegen::QrCode::PENALTY_N4 = 10
staticprivate
int qrcodegen::QrCode::size
private
int qrcodegen::QrCode::version
private

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