58 inline bool isValid()
const override;
103 QRCodeBase(CT_MICRO, std::move(data), encodingMode, errorCorrectionCapacity, std::move(modules), version)
156 if (version_ < MIN_VERSION || version_ >
MAX_VERSION)
158 ocean_assert(
false &&
"This should never happen!");
164 ocean_assert(
false &&
"This should never happen!");
193 if (symbolNumber > 7u)
198 if (symbolNumber == 0u)
205 if (symbolNumber == 7u)
212 version = (symbolNumber + 3u) / 2u;
Definition of a QR code decoder.
Definition: MicroQRCodeDecoder.h:31
This class implements an encoder and decoder for QR codes.
Definition: MicroQRCodeEncoder.h:37
Definition of a Micro QR code.
Definition: MicroQRCode.h:35
MicroQRCode()=default
Creates an invalid Micro QR code instance.
bool isValid() const override
Returns whether this is a valid QR code instance.
Definition: MicroQRCode.h:108
std::string versionString() const override
Returns the version of the Micro QR code as a string.
Definition: MicroQRCode.h:171
static constexpr unsigned int MIN_VERSION
Indicates the smallest valid version number of Micro QR codes.
Definition: MicroQRCode.h:42
static bool unpackSymbolNumber(const unsigned int symbolNumber, unsigned int &version, ErrorCorrectionCapacity &errorCorrectionCapacity)
Unpacks a Micro QR code symbol number into the version number and error correction capacity.
Definition: MicroQRCode.h:191
unsigned int modulesPerSide() const override
Returns the number of modules per side of the Micro QR code.
Definition: MicroQRCode.h:176
static constexpr unsigned int MAX_VERSION
Indicates the largest valid version number of Micro QR codes.
Definition: MicroQRCode.h:45
Base class for QR code implementations.
Definition: QRCodeBase.h:32
CodeType codeType_
The variant of this QR code.
Definition: QRCodeBase.h:246
std::vector< uint8_t > data_
The plain data.
Definition: QRCodeBase.h:249
ErrorCorrectionCapacity errorCorrectionCapacity_
The error correction capacity that was used to generated this QR code.
Definition: QRCodeBase.h:255
const std::vector< uint8_t > & modules() const
Returns the modules of this QR code The modules are stored in a vector and will have modulesPerSide()...
Definition: QRCodeBase.h:290
std::vector< uint8_t > modules_
The modules of the QR code that store the data.
Definition: QRCodeBase.h:258
@ CT_MICRO
Indicates a Micro QR codes.
Definition: QRCodeBase.h:45
virtual std::string versionString() const
Returns the version of the QR code as a string.
Definition: QRCodeBase.h:310
unsigned int version() const
Returns the version of the QR code.
Definition: QRCodeBase.h:305
unsigned int version_
The version of the QR code.
Definition: QRCodeBase.h:261
const std::vector< uint8_t > & data() const
Returns a constant reference to the plain data of the QR code.
Definition: QRCodeBase.h:280
EncodingMode
Definition of encoding modes.
Definition: QRCodeBase.h:72
@ EM_ALPHANUMERIC
Mode that supports A-Z, 0-9 and a few others, cf. ALPHANUMERIC_CHARSET
Definition: QRCodeBase.h:76
@ EM_NUMERIC
Mode that supports digits 0-9.
Definition: QRCodeBase.h:74
@ EM_BYTE
Mode that represents data as a sequence of bytes.
Definition: QRCodeBase.h:78
@ EM_INVALID_ENCODING_MODE
Indicator for an invalid encoding mode.
Definition: QRCodeBase.h:92
ErrorCorrectionCapacity
Enumeration of the levels of error correction The value of the enums correspond to the standard-defin...
Definition: QRCodeBase.h:53
@ ECC_15
Indicates that 15% of the modules reserved error correction.
Definition: QRCodeBase.h:57
@ ECC_30
Indicates that 30% of the modules reserved error correction.
Definition: QRCodeBase.h:61
@ ECC_25
Indicates that 25% of the modules reserved error correction.
Definition: QRCodeBase.h:59
@ ECC_INVALID
Indicator for an invalid error correction capacity.
Definition: QRCodeBase.h:65
@ ECC_07
Indicates that 7% of the modules reserved error correction.
Definition: QRCodeBase.h:55
@ ECC_DETECTION_ONLY
Indicates that the capacity is limited to error detection only (used only by Micro QR Code version M1...
Definition: QRCodeBase.h:63
ErrorCorrectionCapacity errorCorrectionCapacity() const
Returns the error correction capacity of the QR code.
Definition: QRCodeBase.h:300
EncodingMode encodingMode_
The encoding mode that was used to generate this QR code.
Definition: QRCodeBase.h:252
EncodingMode encodingMode() const
Returns the encoding mode of the QR code.
Definition: QRCodeBase.h:295
std::vector< MicroQRCode > MicroQRCodes
Definition of a vector of Micro QR codes.
Definition: MicroQRCode.h:25
std::vector< QRCode > QRCodes
Definition of a vector of QR codes.
Definition: QRCode.h:25
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15