zxing-cpp v3.0
Loading...
Searching...
No Matches
ZXing Namespace Reference

Namespaces

namespace  BarcodeExtra

Classes

class  Barcode
class  BarcodeFormats
class  ReaderOptions
class  CreatorOptions
class  WriterOptions
class  ImageView
class  Image
class  Quadrilateral
struct  PointT
class  Error

Typedefs

using Position = QuadrilateralI
using Barcodes = std::vector<Barcode>
template<std::size_t N>
using BarcodeFormatArray = std::array<BarcodeFormat, N>
using QuadrilateralF = Quadrilateral<PointF>
using QuadrilateralI = Quadrilateral<PointI>
using PointI = PointT<int>
using PointF = PointT<double>

Enumerations

enum class  BarcodeFormat : unsigned int
enum class  Binarizer : unsigned char
enum class  EanAddOnSymbol : unsigned char
enum class  TextMode : unsigned char
enum class  ImageFormat : uint32_t

Functions

Barcode MergeStructuredAppendSequence (const Barcodes &barcodes)
Barcodes MergeStructuredAppendSequences (const Barcodes &barcodes)
BarcodeFormat Symbology (BarcodeFormat format)
std::string_view Name (BarcodeFormat format)
bool operator<= (BarcodeFormat e, BarcodeFormat s)
bool operator& (BarcodeFormat a, BarcodeFormat b)
constexpr BarcodeFormatArray< 2 > operator| (BarcodeFormat a, BarcodeFormat b)
template<std::size_t N>
constexpr BarcodeFormatArray< N+1 > operator| (BarcodeFormatArray< N > bts, BarcodeFormat bt)
template<std::size_t N>
constexpr bool operator& (BarcodeFormat lhs, const BarcodeFormatArray< N > &rhs)
BarcodeFormat BarcodeFormatFromString (std::string_view str)
std::string ToString (BarcodeFormat format)
bool operator<= (BarcodeFormat lhs, const BarcodeFormats &rhs)
bool operator& (BarcodeFormat lhs, const BarcodeFormats &rhs)
BarcodeFormats BarcodeFormatsFromString (std::string_view str)
std::string ToString (const BarcodeFormats &formats)
Barcode CreateBarcodeFromText (std::string_view contents, const CreatorOptions &options)
Barcode CreateBarcodeFromBytes (const void *data, int size, const CreatorOptions &options)
template<typename R>
Barcode CreateBarcodeFromBytes (const R &contents, const CreatorOptions &options)
std::string WriteBarcodeToSVG (const Barcode &barcode, const WriterOptions &options={})
std::string WriteBarcodeToUtf8 (const Barcode &barcode, const WriterOptions &options={})
Image WriteBarcodeToImage (const Barcode &barcode, const WriterOptions &options={})
Barcode ReadBarcode (const ImageView &image, const ReaderOptions &options={})
Barcodes ReadBarcodes (const ImageView &image, const ReaderOptions &options={})
template<typename T>
std::string ToString (const Quadrilateral< PointT< T > > &points)
template<typename T>
std::string ToString (const PointT< T > &p, bool swap=false, char delim='x')
std::string ToString (const Error &e)
const std::string & Version ()

Typedef Documentation

◆ Position

◆ Barcodes

using ZXing::Barcodes = std::vector<Barcode>

◆ BarcodeFormatArray

template<std::size_t N>
using ZXing::BarcodeFormatArray = std::array<BarcodeFormat, N>

◆ QuadrilateralF

◆ QuadrilateralI

◆ PointI

using ZXing::PointI = PointT<int>

◆ PointF

using ZXing::PointF = PointT<double>

Enumeration Type Documentation

◆ BarcodeFormat

enum class ZXing::BarcodeFormat : unsigned int
strong

Enumerates barcode formats known to this package.

Some formats represent a symbology (e.g. EANUPC) with multiple variants (EAN13, EAN8, etc.), while others represent a specific symbology variant (e.g. MicroQRCode). Both can be used with ReaderOptions::formats() to select which formats to read/scan for, but only specific variants are returned by the library when reading barcodes.

If the format name starts with "All", it is a pseudo-format representing a set of formats (e.g. AllLinear, AllGS1, etc.). These can be used for filtering and selection purposes, but are not returned by the library when reading barcodes and can not be used when creating barcodes.

Enumerator
None 
All 
AllReadable 
AllCreatable 
AllLinear 
AllMatrix 
AllGS1 
AllRetail 
AllIndustrial 
Codabar 
Code39 
Code39Std 
Code39Ext 
Code32 
PZN 
Code93 
Code128 
ITF 
ITF14 
DataBar 
DataBarOmni 
DataBarStk 
DataBarStkOmni 
DataBarLtd 
DataBarExp 
DataBarExpStk 
EANUPC 
EAN13 
EAN8 
EAN5 
EAN2 
ISBN 
UPCA 
UPCE 
OtherBarcode 
DXFilmEdge 
PDF417 
CompactPDF417 
MicroPDF417 
Aztec 
AztecCode 
AztecRune 
QRCode 
QRCodeModel1 
QRCodeModel2 
MicroQRCode 
RMQRCode 
DataMatrix 
MaxiCode 

◆ Binarizer

enum class ZXing::Binarizer : unsigned char
strong

Specify which algorithm to use for the grayscale to binary transformation.

The difference is how to get to a threshold value T which results in a bit value R(esult) = L(uminance) <= T(hreshold).

Enumerator
LocalAverage 

T = average of neighboring pixels for matrix and GlobalHistogram for linear (HybridBinarizer).

GlobalHistogram 

T = valley between the 2 largest peaks in the histogram (per line in linear case).

FixedThreshold 

T = 127.

BoolCast 

T = 0, fastest possible.

◆ EanAddOnSymbol

enum class ZXing::EanAddOnSymbol : unsigned char
strong
Enumerator
Ignore 

Ignore any Add-On symbol during read/scan.

Read 

Read EAN-2/EAN-5 Add-On symbol if found.

Require 

Require EAN-2/EAN-5 Add-On symbol to be present.

◆ TextMode

enum class ZXing::TextMode : unsigned char
strong

Specify how the decoded byte content of a barcode should be transcoded to text.

See also
Barcode::text(), ReaderOptions::textMode().
Enumerator
Plain 

bytes() transcoded to unicode based on ECI info or guessed charset (the default mode prior to 2.0)

ECI 

standard content following the ECI protocol with every character set ECI segment transcoded to unicode

HRI 

Human Readable Interpretation (dependent on the ContentType).

Escaped 

Use the EscapeNonGraphical() function (e.g. ASCII 29 will be transcoded to "<GS>").

Hex 

bytes() transcoded to ASCII string of HEX values

HexECI 

bytesECI() transcoded to ASCII string of HEX values

◆ ImageFormat

enum class ZXing::ImageFormat : uint32_t
strong

Supported image formats for ImageView. The format encodes the pixel format and layout information.

Enumerator
None 
Lum 
LumA 
RGB 
BGR 
RGBA 
ARGB 
BGRA 
ABGR 
RGBX 
XRGB 
BGRX 
XBGR 

Function Documentation

◆ MergeStructuredAppendSequence()

Barcode ZXing::MergeStructuredAppendSequence ( const Barcodes & barcodes)

Merge a list of Barcodes from one Structured Append sequence to a single barcode.

◆ MergeStructuredAppendSequences()

Barcodes ZXing::MergeStructuredAppendSequences ( const Barcodes & barcodes)

Automatically merge all Structured Append sequences found in the given list of barcodes.

◆ Symbology()

BarcodeFormat ZXing::Symbology ( BarcodeFormat format)

Returns the symbology (base type) of the given barcode format (e.g. EAN/UPC for EAN13, EAN8, UPCA, etc.).

◆ Name()

std::string_view ZXing::Name ( BarcodeFormat format)

Returns the human-readable name of the given barcode format.

◆ operator<=() [1/2]

bool ZXing::operator<= ( BarcodeFormat e,
BarcodeFormat s )

Test if left hand side (e == element) is 'inside' right hand side (s == set) (e.g. MicroQRCode <= QRCode).

◆ operator&() [1/3]

bool ZXing::operator& ( BarcodeFormat a,
BarcodeFormat b )

Test if the two BarcodeFormats have a non-empty intersection (e.g. AllMatrix & QRCode).

◆ operator|() [1/2]

BarcodeFormatArray< 2 > ZXing::operator| ( BarcodeFormat a,
BarcodeFormat b )
constexpr

◆ operator|() [2/2]

template<std::size_t N>
BarcodeFormatArray< N+1 > ZXing::operator| ( BarcodeFormatArray< N > bts,
BarcodeFormat bt )
constexpr

◆ operator&() [2/3]

template<std::size_t N>
bool ZXing::operator& ( BarcodeFormat lhs,
const BarcodeFormatArray< N > & rhs )
constexpr

◆ BarcodeFormatFromString()

BarcodeFormat ZXing::BarcodeFormatFromString ( std::string_view str)

Parse a string into a BarcodeFormat. '-', '_', '/' and ' ' are optional.

Exceptions
std::invalid_parameterif the string can not be fully parsed.

◆ ToString() [1/5]

std::string ZXing::ToString ( BarcodeFormat format)

◆ operator<=() [2/2]

bool ZXing::operator<= ( BarcodeFormat lhs,
const BarcodeFormats & rhs )
inline

◆ operator&() [3/3]

bool ZXing::operator& ( BarcodeFormat lhs,
const BarcodeFormats & rhs )
inline

◆ BarcodeFormatsFromString()

BarcodeFormats ZXing::BarcodeFormatsFromString ( std::string_view str)

Parses a string into a set of BarcodeFormats. Separators can be (any combination of) '|' or ','. Input can be lower case and any of '-', '_', '/' or ' ' are optional, e.g. "EAN-8 | qrcode, Itf" would be parsed into [EAN8, QRCode, ITF].

Exceptions
std::invalid_parameterif the string can not be fully parsed.

◆ ToString() [2/5]

std::string ZXing::ToString ( const BarcodeFormats & formats)

◆ CreateBarcodeFromText()

Barcode ZXing::CreateBarcodeFromText ( std::string_view contents,
const CreatorOptions & options )

Generate Barcode from unicode text.

Parameters
contentsUTF-8 string to encode into a barcode
optionsCreatorOptions (including BarcodeFormat)

◆ CreateBarcodeFromBytes() [1/2]

Barcode ZXing::CreateBarcodeFromBytes ( const void * data,
int size,
const CreatorOptions & options )

Generate Barcode from raw binary data.

Parameters
dataarray of bytes to encode into a barcode
sizesize of byte array
optionsCreatorOptions (including BarcodeFormat)

◆ CreateBarcodeFromBytes() [2/2]

template<typename R>
Barcode ZXing::CreateBarcodeFromBytes ( const R & contents,
const CreatorOptions & options )

◆ WriteBarcodeToSVG()

std::string ZXing::WriteBarcodeToSVG ( const Barcode & barcode,
const WriterOptions & options = {} )

Write barcode symbol to SVG.

◆ WriteBarcodeToUtf8()

std::string ZXing::WriteBarcodeToUtf8 ( const Barcode & barcode,
const WriterOptions & options = {} )

Write barcode symbol to a utf8 string using graphical characters (e.g. '▀').

◆ WriteBarcodeToImage()

Image ZXing::WriteBarcodeToImage ( const Barcode & barcode,
const WriterOptions & options = {} )

Write barcode symbol to Image (Bitmap).

◆ ReadBarcode()

Barcode ZXing::ReadBarcode ( const ImageView & image,
const ReaderOptions & options = {} )

Read barcode from an ImageView

Parameters
imageview of the image data including layout and format
optionsoptional ReaderOptions to parameterize / speed up detection
Returns
Barcode found, if any, otherwise a Barcode with empty content and format ZXing::BarcodeFormat::None

◆ ReadBarcodes()

Barcodes ZXing::ReadBarcodes ( const ImageView & image,
const ReaderOptions & options = {} )

Read barcodes from an ImageView

Parameters
imageview of the image data including layout and format
optionsoptional ReaderOptions to parameterize / speed up detection
Returns
List of Barcode found, may be empty

◆ ToString() [3/5]

template<typename T>
std::string ZXing::ToString ( const Quadrilateral< PointT< T > > & points)

◆ ToString() [4/5]

template<typename T>
std::string ZXing::ToString ( const PointT< T > & p,
bool swap = false,
char delim = 'x' )

◆ ToString() [5/5]

std::string ZXing::ToString ( const Error & e)

◆ Version()

const std::string & ZXing::Version ( )