47 public:
class Ecc final {
56 private:
Ecc(
int ord,
int fb);
96 int minVersion=1,
int maxVersion=40,
int mask=-1,
bool boostEcl=
true);
127 private: std::vector<std::vector<bool> >
modules;
139 public:
QrCode(
int ver,
Ecc ecl,
const std::vector<std::uint8_t> &dataCodewords,
int mask);
162 public:
bool getModule(
int x,
int y)
const;
203 private:
bool module(
int x,
int y)
const;
210 private: std::vector<std::uint8_t>
appendErrorCorrection(
const std::vector<std::uint8_t> &data)
const;
215 private:
void drawCodewords(
const std::vector<std::uint8_t> &data);
302 public: std::vector<std::uint8_t>
getRemainder(
const std::vector<std::uint8_t> &data)
const;
309 private:
static std::uint8_t
multiply(std::uint8_t x, std::uint8_t y);
static const Ecc LOW
Definition: QrCode.h:49
static const int PENALTY_N4
Definition: QrCode.h:263
void drawFinderPattern(int x, int y)
Definition: QrCode.cpp:276
int version
Definition: QrCode.h:112
static constexpr int MAX_VERSION
Definition: QrCode.h:103
static const int PENALTY_N3
Definition: QrCode.h:262
static const int PENALTY_N1
Definition: QrCode.h:260
bool getModule(int x, int y) const
Definition: QrCode.cpp:162
void drawFormatBits(int mask)
Definition: QrCode.cpp:225
std::vector< std::uint8_t > coefficients
Definition: QrCode.h:283
int getOrdinal() const
Definition: QrCode.cpp:46
static const std::int8_t NUM_ERROR_CORRECTION_BLOCKS[4][41]
Definition: QrCode.h:266
static QrCode encodeSegments(const std::vector< QrSegment > &segs, Ecc ecl, int minVersion=1, int maxVersion=40, int mask=-1, bool boostEcl=true)
Definition: QrCode.cpp:74
static const Ecc HIGH
Definition: QrCode.h:49
long getPenaltyScore() const
Definition: QrCode.cpp:419
static std::uint8_t multiply(std::uint8_t x, std::uint8_t y)
Definition: QrCode.cpp:611
int formatBits
Definition: QrCode.h:53
Ecc getErrorCorrectionLevel() const
Definition: QrCode.cpp:152
static QrCode encodeText(const char *text, Ecc ecl)
Definition: QrCode.cpp:62
static int getNumRawDataModules(int ver)
Definition: QrCode.cpp:522
std::vector< std::uint8_t > appendErrorCorrection(const std::vector< std::uint8_t > &data) const
Definition: QrCode.cpp:307
int getMask() const
Definition: QrCode.cpp:157
void drawFunctionPatterns()
Definition: QrCode.cpp:195
std::string toSvgString(int border) const
Definition: QrCode.cpp:167
int getFormatBits() const
Definition: QrCode.cpp:51
Ecc errorCorrectionLevel
Definition: QrCode.h:119
bool module(int x, int y) const
Definition: QrCode.cpp:302
int ordinal
Definition: QrCode.h:52
void drawAlignmentPattern(int x, int y)
Definition: QrCode.cpp:288
ReedSolomonGenerator(int degree)
Definition: QrCode.cpp:572
static QrCode encodeBinary(const std::vector< std::uint8_t > &data, Ecc ecl)
Definition: QrCode.cpp:68
static std::vector< int > getAlignmentPatternPositions(int ver)
Definition: QrCode.cpp:499
static const std::int8_t ECC_CODEWORDS_PER_BLOCK[4][41]
Definition: QrCode.h:265
static const Ecc MEDIUM
Definition: QrCode.h:49
Ecc(int ord, int fb)
Definition: QrCode.cpp:41
int getSize() const
Definition: QrCode.cpp:147
QrCode(int ver, Ecc ecl, const std::vector< std::uint8_t > &dataCodewords, int mask)
Definition: QrCode.cpp:122
std::vector< std::vector< bool > > isFunction
Definition: QrCode.h:128
static const int PENALTY_N2
Definition: QrCode.h:261
static constexpr int MIN_VERSION
Definition: QrCode.h:102
std::vector< std::uint8_t > getRemainder(const std::vector< std::uint8_t > &data) const
Definition: QrCode.cpp:597
int size
Definition: QrCode.h:116
static const Ecc QUARTILE
Definition: QrCode.h:49
int getVersion() const
Definition: QrCode.cpp:142
static int getNumDataCodewords(int ver, Ecc ecl)
Definition: QrCode.cpp:536
void applyMask(int mask)
Definition: QrCode.cpp:374
void drawCodewords(const std::vector< std::uint8_t > &data)
Definition: QrCode.cpp:346
void setFunctionModule(int x, int y, bool isBlack)
Definition: QrCode.cpp:296
std::vector< std::vector< bool > > modules
Definition: QrCode.h:127
int handleConstructorMasking(int mask)
Definition: QrCode.cpp:397
void drawVersion()
Definition: QrCode.cpp:254
int mask
Definition: QrCode.h:124