zxing-cpp v3.0
Loading...
Searching...
No Matches
ZXing::CreatorOptions Class Reference

#include <CreateBarcode.h>

Public Member Functions

 CreatorOptions (BarcodeFormat format, std::string options={})
 ~CreatorOptions ()
 CreatorOptions (CreatorOptions &&) noexcept
CreatorOptionsoperator= (CreatorOptions &&) noexcept
zint_symbol * zint () const
const BarcodeFormatformat () const noexcept
CreatorOptionsformat (BarcodeFormat v) &
CreatorOptions && format (BarcodeFormat v) &&
const std::string & options () const noexcept
CreatorOptionsoptions (std::string v) &
CreatorOptions && options (std::string v) &&
std::optional< std::string > ecLevel () const noexcept
std::optional< std::string > eci () const noexcept
std::optional< bool > gs1 () const noexcept
std::optional< bool > readerInit () const noexcept
std::optional< bool > forceSquare () const noexcept
std::optional< int > columns () const noexcept
std::optional< int > rows () const noexcept
std::optional< int > version () const noexcept
std::optional< int > dataMask () const noexcept

Friends

Barcode CreateBarcode (const void *data, int size, int mode, const CreatorOptions &options)

Detailed Description

Configuration options for barcode creation.

This class encapsulates all the parameters needed to create a barcode with specific format and settings.

The options property is a string that can contain multiple key-value pairs separated by commas. Each key-value pair configures a specific aspect of the barcode generation process and are dependent on the used BarcodeFormat. Boolean properties are interpreted as true if only the property name is present. Keys are case-insensitive. Passing a serialized JSON object is also supported.

For a list of all supported options, see the list of read-only properties below.

// example of creating a QR code with 30% error correction level and GS1 mode enabled
auto opts = CreatorOptions(BarcodeFormat::QRCode, "ecLevel=30%, gs1");
CreatorOptions(BarcodeFormat format, std::string options={})
@ QRCode
Definition BarcodeFormat.h:100

Constructor & Destructor Documentation

◆ CreatorOptions() [1/2]

ZXing::CreatorOptions::CreatorOptions ( BarcodeFormat format,
std::string options = {} )

◆ ~CreatorOptions()

ZXing::CreatorOptions::~CreatorOptions ( )

◆ CreatorOptions() [2/2]

ZXing::CreatorOptions::CreatorOptions ( CreatorOptions && )
noexcept

Member Function Documentation

◆ operator=()

CreatorOptions & ZXing::CreatorOptions::operator= ( CreatorOptions && )
noexcept

◆ zint()

zint_symbol * ZXing::CreatorOptions::zint ( ) const

◆ format() [1/3]

const BarcodeFormat & ZXing::CreatorOptions::format ( ) const
noexcept

◆ format() [2/3]

CreatorOptions & ZXing::CreatorOptions::format ( BarcodeFormat v) &

◆ format() [3/3]

CreatorOptions && ZXing::CreatorOptions::format ( BarcodeFormat v) &&

◆ options() [1/3]

const std::string & ZXing::CreatorOptions::options ( ) const
noexcept

◆ options() [2/3]

CreatorOptions & ZXing::CreatorOptions::options ( std::string v) &

◆ options() [3/3]

CreatorOptions && ZXing::CreatorOptions::options ( std::string v) &&

◆ ecLevel()

std::optional< std::string > ZXing::CreatorOptions::ecLevel ( ) const
noexcept

most 2D symbologies: ecLevel, e.g. "30%", see also libzint docs for supported values per symbology

◆ eci()

std::optional< std::string > ZXing::CreatorOptions::eci ( ) const
noexcept

most 2D symbologies: specify ECI designator to use (e.g. "UTF-8" or "26" for UTF-8), see also libzint docs

◆ gs1()

std::optional< bool > ZXing::CreatorOptions::gs1 ( ) const
noexcept

GS1 mode.

◆ readerInit()

std::optional< bool > ZXing::CreatorOptions::readerInit ( ) const
noexcept

most 2D symbologies: set the "reader init" flag

◆ forceSquare()

std::optional< bool > ZXing::CreatorOptions::forceSquare ( ) const
noexcept

DataMatrix: only consider square symbol versions.

◆ columns()

std::optional< int > ZXing::CreatorOptions::columns ( ) const
noexcept

specify number of columns (e.g. for DataBarExpStk, PDF417)

◆ rows()

std::optional< int > ZXing::CreatorOptions::rows ( ) const
noexcept

specify number of rows (e.g. for DataBarExpStk, PDF417)

◆ version()

std::optional< int > ZXing::CreatorOptions::version ( ) const
noexcept

most 2D symbologies: specify the version/size of the symbol

◆ dataMask()

std::optional< int > ZXing::CreatorOptions::dataMask ( ) const
noexcept

QRCode/MicroQRCode: specify dataMask to use.

◆ CreateBarcode

Barcode CreateBarcode ( const void * data,
int size,
int mode,
const CreatorOptions & options )
friend

The documentation for this class was generated from the following file: