|
zxing-cpp v3.0
|
#include <Barcode.h>
Public Member Functions | |
| Barcode () | |
| Barcode (Barcode::Data &&data) | |
| bool | isValid () const |
| const Error & | error () const |
| BarcodeFormat | format () const |
| BarcodeFormat | symbology () const |
| const std::vector< uint8_t > & | bytes () const |
| std::vector< uint8_t > | bytesECI () const |
| std::string | text (TextMode mode) const |
| std::string | text () const |
| ContentType | contentType () const |
| bool | hasECI () const |
| const Position & | position () const |
| int | orientation () const |
| bool | isMirrored () const |
| bool | isInverted () const |
| std::string | symbologyIdentifier () const |
| int | sequenceSize () const |
| int | sequenceIndex () const |
| std::string | sequenceId () const |
| bool | isLastInSequence () const |
| bool | isPartOfSequence () const |
| int | lineCount () const |
| ImageView | symbol () const |
| std::string | extra (std::string_view key="") const |
| bool | operator== (const Barcode &o) const |
Friends | |
| Barcode | MergeStructuredAppendSequence (const Barcodes &barcodes) |
| Barcodes | ReadBarcodes (const ImageView &image, const ReaderOptions &options={}) |
| Barcode | CreateBarcode (const void *, int, int, const CreatorOptions &) |
| Image | WriteBarcodeToImage (const Barcode &barcode, const WriterOptions &options={}) |
| std::string | WriteBarcodeToSVG (const Barcode &barcode, const WriterOptions &options={}) |
The Barcode class encapsulates a decoded or created barcode symbol.
Barcode represents a decoded or created barcode symbol, providing access to its content, format, position, and other metadata. It serves as the primary interface for working with barcodes in the library.
Barcode objects are obtained from the ReadBarcodes function when scanning an image, or from the CreateBarcodeFrom... functions when generating a new barcode. To convert a Barcode to an image or SVG, use the WriteBarcodeTo... functions.
| ZXing::Barcode::Barcode | ( | ) |
| ZXing::Barcode::Barcode | ( | Barcode::Data && | data | ) |
| bool ZXing::Barcode::isValid | ( | ) | const |
Returns whether the barcode is valid, i.e. it contains a successfully decoded or created symbol.
| const Error & ZXing::Barcode::error | ( | ) | const |
Returns the error associated with the barcode, if any.
| BarcodeFormat ZXing::Barcode::format | ( | ) | const |
Returns the BarcodeFormat of the barcode.
|
inline |
Returns the symbology of the barcode format (e.g. EAN/UPC for EAN13, EAN8, UPCA, etc.).
| const std::vector< uint8_t > & ZXing::Barcode::bytes | ( | ) | const |
Returns the raw / standard content without any modifications like character set conversions.
| std::vector< uint8_t > ZXing::Barcode::bytesECI | ( | ) | const |
Returns the raw / standard content following the ECI protocol.
| std::string ZXing::Barcode::text | ( | TextMode | mode | ) | const |
| std::string ZXing::Barcode::text | ( | ) | const |
Returns the bytes() content rendered to unicode/utf8 text according to the TextMode set in the ReaderOptions.
| ContentType ZXing::Barcode::contentType | ( | ) | const |
Returns the content type, giving a hint to the type of content found (Text/Binary/GS1/etc.).
| bool ZXing::Barcode::hasECI | ( | ) | const |
Returns whether or not an ECI tag was found.
| const Position & ZXing::Barcode::position | ( | ) | const |
Returns the position of the barcode in the image as a quadrilateral of 4 points (topLeft, topRight, bottomRight, bottomLeft).
| int ZXing::Barcode::orientation | ( | ) | const |
Returns the orientation of the barcode in degrees, see also Position::orientation().
| bool ZXing::Barcode::isMirrored | ( | ) | const |
Returns whether the symbol is mirrored (currently only supported by QRCode and DataMatrix).
| bool ZXing::Barcode::isInverted | ( | ) | const |
Returns whether the symbol is inverted / has reversed reflectance (see ReaderOptions::tryInvert).
| std::string ZXing::Barcode::symbologyIdentifier | ( | ) | const |
Returns the symbology identifier "]cm" where "c" is symbology code character, "m" the modifier.
| int ZXing::Barcode::sequenceSize | ( | ) | const |
Returns the number of symbols in a structured append sequence.
If this is not part of a structured append sequence, the returned value is -1. If it is a structured append symbol but the total number of symbols is unknown, the returned value is 0 (see PDF417 if optional "Segment Count" not given).
| int ZXing::Barcode::sequenceIndex | ( | ) | const |
Returns the 0-based index of this symbol in a structured append sequence.
| std::string ZXing::Barcode::sequenceId | ( | ) | const |
Returns the sequenceId to check if a set of symbols belongs to the same structured append sequence.
If the symbology does not support this feature, the returned value is empty (see MaxiCode). For QR Code, this is the parity integer converted to a string. For PDF417 and DataMatrix, this is the "fileId".
|
inline |
Returns whether this symbol is the last in a structured append sequence.
|
inline |
Returns whether this symbol is part of a structured append sequence.
| int ZXing::Barcode::lineCount | ( | ) | const |
Returns how many lines have been detected with this code (applies only to linear symbologies).
| std::string ZXing::Barcode::extra | ( | std::string_view | key = "" | ) | const |
Retrieve supplementary metadata associated with this barcode.
Returns a string containing additional and symbology specific information. In form of a JSON object serialization. The optional parameter key can be used to retrieve a specific item only. Key values are case insensitive. See BarcodeExtra namespace for valid keys. If the key is not found or there is no info available, an empty string is returned.
| bool ZXing::Barcode::operator== | ( | const Barcode & | o | ) | const |
Merge a list of Barcodes from one Structured Append sequence to a single barcode.
|
friend |
Read barcodes from an ImageView
| image | view of the image data including layout and format |
| options | optional ReaderOptions to parameterize / speed up detection |
|
friend |
|
friend |
Write barcode symbol to Image (Bitmap).
|
friend |
Write barcode symbol to SVG.