|
Ocean
|
Base class for QR code implementations. More...
#include <QRCodeBase.h>
Public Types | |
| enum | CodeType : unsigned int { CT_UNDEFINED = 0u , CT_STANDARD , CT_MICRO } |
| Definition of available types of codes. More... | |
| enum | ErrorCorrectionCapacity : uint32_t { ECC_07 = 0b01u , ECC_15 = 0b00u , ECC_25 = 0b11u , ECC_30 = 0b10u , ECC_DETECTION_ONLY = 5u , ECC_INVALID = uint32_t(-1) } |
| Enumeration of the levels of error correction The value of the enums correspond to the standard-defined bit sequences (2 bits long) More... | |
| enum | EncodingMode : uint32_t { EM_NUMERIC = 0u , EM_ALPHANUMERIC , EM_BYTE , EM_KANJI , EM_ECI , EM_STRUCTURED_APPEND , EM_FNC1 , EM_INVALID_ENCODING_MODE = uint32_t(-1) } |
| Definition of encoding modes. More... | |
Public Member Functions | |
| virtual | ~QRCodeBase ()=default |
| Destructs a QR code instance. | |
| virtual bool | isValid () const =0 |
| Returns whether this is a valid QR code instance. | |
| CodeType | codeType () const |
| Returns the type or variant of this code. | |
| const std::vector< uint8_t > & | data () const |
| Returns a constant reference to the plain data of the QR code. | |
| std::string | dataString () const |
| Return the plain data of the QR code as a string, if possible. | |
| 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() * modulesPerSide() elements (row-wise order) | |
| EncodingMode | encodingMode () const |
| Returns the encoding mode of the QR code. | |
| ErrorCorrectionCapacity | errorCorrectionCapacity () const |
| Returns the error correction capacity of the QR code. | |
| unsigned int | version () const |
| Returns the version of the QR code. | |
| virtual std::string | versionString () const |
| Returns the version of the QR code as a string. | |
| virtual unsigned int | modulesPerSide () const =0 |
| Returns the number of modules per side of the QR code. | |
| bool | isSame (const QRCodeBase &otherCode, const bool ignoreModules) const |
| Checks if another code is identical to this one. | |
| bool | operator== (const QRCodeBase &otherCode) const |
| Checks for equality with another QR code Two QR codes are equal iff they store identical data, use the same configuration, and have identical modules. | |
| bool | operator!= (const QRCodeBase &otherCode) const |
| Checks for inequality with another QR code. | |
Static Public Member Functions | |
| static std::string | translateEncodingMode (const EncodingMode encodingMode) |
| Translates an encoding mode enum into a human-readable string. | |
| static std::string | translateErrorCorrectionCapacity (const ErrorCorrectionCapacity errorCorrectionCapacity) |
| Translates an error correction capacity enum into a human-readable string. | |
| static unsigned int | getErrorCorrectionCapacityValue (const ErrorCorrectionCapacity errorCorrectionCapacity) |
| Returns the integer value of an error correction capacity. | |
| static std::string | translateCodeType (const CodeType codeType) |
| Translate the code type into a human-readable string. | |
Protected Member Functions | |
| QRCodeBase ()=default | |
| Creates an invalid QR code instance. | |
| QRCodeBase (const CodeType codeType, std::vector< uint8_t > &&data, const EncodingMode encodingMode, const ErrorCorrectionCapacity errorCorrectionCapacity, std::vector< uint8_t > &&modules, const unsigned int version) | |
| Creates an QR code instance. | |
| QRCodeBase (const QRCodeBase &otherCode)=default | |
| Copy constructor. | |
| QRCodeBase & | operator= (const QRCodeBase &otherCode)=default |
| Copy assignment operator. | |
Protected Attributes | |
| CodeType | codeType_ = CT_UNDEFINED |
| The variant of this QR code. | |
| std::vector< uint8_t > | data_ |
| The plain data. | |
| EncodingMode | encodingMode_ = EM_INVALID_ENCODING_MODE |
| The encoding mode that was used to generate this QR code. | |
| ErrorCorrectionCapacity | errorCorrectionCapacity_ = ECC_INVALID |
| The error correction capacity that was used to generated this QR code. | |
| std::vector< uint8_t > | modules_ |
| The modules of the QR code that store the data. | |
| unsigned int | version_ = 0u |
| The version of the QR code. | |
Base class for QR code implementations.
| enum Ocean::CV::Detector::QRCodes::QRCodeBase::CodeType : unsigned int |
| enum Ocean::CV::Detector::QRCodes::QRCodeBase::EncodingMode : uint32_t |
Definition of encoding modes.
Enumeration of the levels of error correction The value of the enums correspond to the standard-defined bit sequences (2 bits long)
|
virtualdefault |
Destructs a QR code instance.
|
protecteddefault |
Creates an invalid QR code instance.
|
inlineexplicitprotected |
Creates an QR code instance.
| codeType | The type or variant of this codes, must not be CT_UNDEFINED. |
| data | The plain data of this QR code, must be valid |
| encodingMode | The encoding mode that was used to encode the data, must not be EM_INVALID_ENCODING_MODE |
| errorCorrectionCapacity | The error correction capacity that was used to generate this QR code, must not be ECC_INVALID |
| modules | The modules of the QR code that store the data, must be valid |
| version | The version of the QR code, range: [1, 40] |
|
inlineprotecteddefault |
Copy constructor.
|
inline |
Returns the type or variant of this code.
|
inline |
Returns a constant reference to the plain data of the QR code.
|
inline |
Return the plain data of the QR code as a string, if possible.
EM_NUMERIC or EM_ALPHANUMERIC, otherwise an empty string is returned
|
inline |
Returns the encoding mode of the QR code.
|
inline |
Returns the error correction capacity of the QR code.
|
inlinestatic |
Returns the integer value of an error correction capacity.
| errorCorrectionCapacity | The error correction capacity that will be converted into an integer |
|
inline |
Checks if another code is identical to this one.
| otherCode | The code that will be compared against for identity, must be valid. |
| ignoreModules | True, identical modules in both codes will not be required, otherwise they will. |
|
inlinepure virtual |
Returns whether this is a valid QR code instance.
Implemented in Ocean::CV::Detector::QRCodes::MicroQRCode, and Ocean::CV::Detector::QRCodes::QRCode.
|
inline |
Returns the modules of this QR code The modules are stored in a vector and will have modulesPerSide() * modulesPerSide() elements (row-wise order)
|
inlinepure virtual |
Returns the number of modules per side of the QR code.
Implemented in Ocean::CV::Detector::QRCodes::MicroQRCode, and Ocean::CV::Detector::QRCodes::QRCode.
|
inline |
Checks for inequality with another QR code.
|
inlineprotecteddefault |
Copy assignment operator.
|
inline |
Checks for equality with another QR code Two QR codes are equal iff they store identical data, use the same configuration, and have identical modules.
|
inlinestatic |
Translate the code type into a human-readable string.
| codeType | The code type that will be translated into a human-readable string |
|
inlinestatic |
Translates an encoding mode enum into a human-readable string.
| encodingMode | The encoding mode that will be converted into a string |
|
inlinestatic |
Translates an error correction capacity enum into a human-readable string.
| errorCorrectionCapacity | The error correction capacity that will be converted into a string |
|
inline |
Returns the version of the QR code.
|
inlinevirtual |
Returns the version of the QR code as a string.
Reimplemented in Ocean::CV::Detector::QRCodes::MicroQRCode.
|
protected |
The variant of this QR code.
|
protected |
The plain data.
|
protected |
The encoding mode that was used to generate this QR code.
|
protected |
The error correction capacity that was used to generated this QR code.
|
protected |
The modules of the QR code that store the data.
|
protected |
The version of the QR code.