11#include "ContentType.h"
23extern "C" struct zint_symbol;
41 #define ZX_EXTRA(NAME) static constexpr auto NAME = #NAME
65 using Data = BarcodeData;
67 std::shared_ptr<Data> d;
94 const std::vector<uint8_t>&
bytes()
const;
161 std::string
extra(std::string_view key =
"")
const;
177#if defined(ZXING_USE_ZINT) && defined(ZXING_EXPERIMENTAL_API)
178 zint_symbol* zint()
const;
The Barcode class encapsulates a decoded or created barcode symbol.
Definition Barcode.h:64
friend Barcodes ReadBarcodes(const ImageView &, const ReaderOptions &)
int sequenceIndex() const
Returns the 0-based index of this symbol in a structured append sequence.
bool isPartOfSequence() const
Returns whether this symbol is part of a structured append sequence.
Definition Barcode.h:147
const Error & error() const
Returns the error associated with the barcode, if any.
bool isInverted() const
Returns whether the symbol is inverted / has reversed reflectance (see ReaderOptions::tryInvert).
friend std::string WriteBarcodeToSVG(const Barcode &, const WriterOptions &)
Write barcode symbol to SVG.
std::vector< uint8_t > bytesECI() const
Returns the raw / standard content following the ECI protocol.
friend Barcode CreateBarcode(const void *, int, int, const CreatorOptions &)
bool operator==(const Barcode &o) const
ImageView symbol() const
Returns the bit matrix of the symbol as an ImageView.
std::string extra(std::string_view key="") const
Retrieve supplementary metadata associated with this barcode.
int orientation() const
Returns the orientation of the barcode in degrees, see also Position::orientation().
std::string text(TextMode mode) const
Returns the bytes() content rendered to unicode/utf8 text according to specified TextMode.
friend Image WriteBarcodeToImage(const Barcode &, const WriterOptions &)
Write barcode symbol to Image (Bitmap).
const std::vector< uint8_t > & bytes() const
Returns the raw / standard content without any modifications like character set conversions.
std::string symbologyIdentifier() const
Returns the symbology identifier "]cm" where "c" is symbology code character, "m" the modifier.
bool isValid() const
Returns whether the barcode is valid, i.e. it contains a successfully decoded or created symbol.
int sequenceSize() const
Returns the number of symbols in a structured append sequence.
std::string sequenceId() const
Returns the sequenceId to check if a set of symbols belongs to the same structured append sequence.
Barcode(Barcode::Data &&data)
ContentType contentType() const
Returns the content type, giving a hint to the type of content found (Text/Binary/GS1/etc....
bool hasECI() const
Returns whether or not an ECI tag was found.
BarcodeFormat format() const
Returns the BarcodeFormat of the barcode.
bool isMirrored() const
Returns whether the symbol is mirrored (currently only supported by QRCode and DataMatrix).
BarcodeFormat symbology() const
Returns the symbology of the barcode format (e.g. EAN/UPC for EAN13, EAN8, UPCA, etc....
Definition Barcode.h:91
bool isLastInSequence() const
Returns whether this symbol is the last in a structured append sequence.
Definition Barcode.h:144
int lineCount() const
Returns how many lines have been detected with this code (applies only to linear symbologies).
const Position & position() const
friend Barcode MergeStructuredAppendSequence(const Barcodes &)
Merge a list of Barcodes from one Structured Append sequence to a single barcode.
std::string text() const
Returns the bytes() content rendered to unicode/utf8 text according to the TextMode set in the Reader...
Configuration options for barcode creation.
Definition CreateBarcode.h:38
The Error class is a value type for the error() member of Barcode.
Definition Error.h:27
Simple class that inherits ImageView but owns the image data and frees it on destruction.
Definition ImageView.h:164
Simple class that stores a non-owning const pointer to image data plus layout and format information.
Definition ImageView.h:53
Configuration options for barcode reading and decoding behavior.
Definition ReaderOptions.h:74
Configuration options for barcode writing/generation.
Definition WriteBarcode.h:27
Barcodes MergeStructuredAppendSequences(const Barcodes &barcodes)
Automatically merge all Structured Append sequences found in the given list of barcodes.
TextMode
Specify how the decoded byte content of a barcode should be transcoded to text.
Definition ReaderOptions.h:46
BarcodeFormat Symbology(BarcodeFormat format)
Returns the symbology (base type) of the given barcode format (e.g. EAN/UPC for EAN13,...
Quadrilateral< PointI > QuadrilateralI
Definition Quadrilateral.h:61
Barcode MergeStructuredAppendSequence(const Barcodes &barcodes)
Merge a list of Barcodes from one Structured Append sequence to a single barcode.
std::vector< Barcode > Barcodes
Definition Barcode.h:35
QuadrilateralI Position
Definition Barcode.h:34
BarcodeFormat
Enumerates barcode formats known to this package.
Definition BarcodeFormat.h:98