11#include "CharacterSet.h"
76 std::unique_ptr<Data> d;
86#define ZX_PROPERTY(TYPE, NAME, SETTER, ...) \
87 TYPE NAME() const noexcept; \
88 __VA_ARGS__ ReaderOptions& NAME(TYPE v) &; \
89 __VA_ARGS__ ReaderOptions&& NAME(TYPE v) &&; \
90 __VA_ARGS__ inline ReaderOptions& SETTER(TYPE v) & { return NAME(v); } \
91 __VA_ARGS__ inline ReaderOptions&& SETTER(TYPE v) && { return std::move(*this).NAME(v); }
116#ifdef ZXING_EXPERIMENTAL_API
118 ZX_PROPERTY(
bool, tryDenoise, setTryDenoise)
164#pragma GCC diagnostic push
165#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
166#elif defined(_MSC_VER)
168#pragma warning(disable : 4996)
171#define ZX_DEPRECATED_PROPERTY(TYPE, NAME, SETTER, GET_IMPL, SET_IMPL) \
172 [[deprecated]] inline TYPE NAME() const noexcept { return GET_IMPL; } \
173 [[deprecated]] ReaderOptions& NAME(TYPE v) & { SET_IMPL; return *this; } \
174 [[deprecated]] ReaderOptions&& NAME(TYPE v) && { SET_IMPL; return std::move(*this); } \
175 [[deprecated]] inline ReaderOptions& SETTER(TYPE v) & { return NAME(v); } \
176 [[deprecated]] inline ReaderOptions&& SETTER(TYPE v) && { return std::move(*this).NAME(v); }
179 ZX_DEPRECATED_PROPERTY(
bool, tryCode39ExtendedMode, setTryCode39ExtendedMode,
true, (
void)v)
188#undef ZX_DEPRECATED_PROPERTY
191#pragma GCC diagnostic pop
192#elif defined(_MSC_VER)
bool isPure() const noexcept
Set to true if the input contains nothing but a single perfectly aligned barcode (generated image).
EanAddOnSymbol eanAddOnSymbol() const noexcept
Specify whether to ignore, read or require EAN-2/5 add-on symbols while scanning EAN/UPC codes.
ReaderOptions(ReaderOptions &&) noexcept
ReaderOptions & setTryHarder(bool v) &
Definition ReaderOptions.h:105
ReaderOptions & setCharacterSet(CharacterSet v) &
Definition ReaderOptions.h:152
ReaderOptions & setDownscaleFactor(uint8_t v) &
Definition ReaderOptions.h:131
uint8_t maxNumberOfSymbols() const noexcept
The maximum number of symbols (barcodes) to detect / look for in the image with ReadBarcodes.
ReaderOptions & setMaxNumberOfSymbols(uint8_t v) &
Definition ReaderOptions.h:137
ReaderOptions & setTryDownscale(bool v) &
Definition ReaderOptions.h:114
ReaderOptions && setCharacterSet(std::string_view v) &&
Definition ReaderOptions.h:156
uint8_t downscaleFactor() const noexcept
Scale factor used during downscaling, meaningful values are 2, 3 and 4.
uint16_t downscaleThreshold() const noexcept
Image size ( min(width, height) ) threshold at which to start downscaled scanning.
ReaderOptions & setTryRotate(bool v) &
Definition ReaderOptions.h:108
ReaderOptions && setFormats(const BarcodeFormats &v) &&
Definition ReaderOptions.h:102
ReaderOptions & setTextMode(TextMode v) &
Definition ReaderOptions.h:149
const BarcodeFormats & formats() const noexcept
Specify a set of BarcodeFormats that should be searched for, the default is all supported formats.
ReaderOptions & formats(const BarcodeFormats &v) &
Definition ReaderOptions.h:97
ReaderOptions & setReturnErrors(bool v) &
Definition ReaderOptions.h:143
ReaderOptions && formats(const BarcodeFormats &v) &&
Definition ReaderOptions.h:98
ReaderOptions & operator=(const ReaderOptions &)
ReaderOptions & setIsPure(bool v) &
Definition ReaderOptions.h:125
bool tryHarder() const noexcept
Spend more time to try to find a barcode; optimize for accuracy, not speed.
Binarizer binarizer() const noexcept
Binarizer to use internally when using the ReadBarcode function.
ReaderOptions & setFormats(BarcodeFormats &&v) &
Definition ReaderOptions.h:99
ReaderOptions & setDownscaleThreshold(uint16_t v) &
Definition ReaderOptions.h:128
bool tryDownscale() const noexcept
Also try detecting code in downscaled images (depending on image size).
bool tryRotate() const noexcept
Also try detecting code in 90, 180 and 270 degree rotated images.
ReaderOptions & setBinarizer(Binarizer v) &
Definition ReaderOptions.h:122
ReaderOptions & setValidateOptionalChecksum(bool v) &
Definition ReaderOptions.h:140
TextMode textMode() const noexcept
Specifies the TextMode that controls the return of the Barcode::text() function.
ReaderOptions & setEanAddOnSymbol(EanAddOnSymbol v) &
Definition ReaderOptions.h:146
bool validateOptionalChecksum() const noexcept
Validate optional checksums where applicable (e.g. Code39, ITF).
ReaderOptions(const ReaderOptions &)
ReaderOptions & setTryInvert(bool v) &
Definition ReaderOptions.h:111
bool tryInvert() const noexcept
Also try detecting inverted ("reversed reflectance") codes if the format allows for those.
bool returnErrors() const noexcept
If true, return the barcodes with errors as well (e.g. checksum errors, see Barcode::error()).
ReaderOptions & setFormats(const BarcodeFormats &v) &
Definition ReaderOptions.h:101
CharacterSet characterSet() const noexcept
Specifies fallback character set to use instead of auto-detecting it (when applicable).
ReaderOptions && setFormats(BarcodeFormats &&v) &&
Definition ReaderOptions.h:100
uint8_t minLineCount() const noexcept
The number of scan lines in a linear barcode that have to be equal to accept the result,...
ReaderOptions & setMinLineCount(uint8_t v) &
Definition ReaderOptions.h:134
Binarizer
Specify which algorithm to use for the grayscale to binary transformation.
Definition ReaderOptions.h:26
@ LocalAverage
T = average of neighboring pixels for matrix and GlobalHistogram for linear (HybridBinarizer).
Definition ReaderOptions.h:27
@ FixedThreshold
T = 127.
Definition ReaderOptions.h:29
@ BoolCast
T = 0, fastest possible.
Definition ReaderOptions.h:30
@ GlobalHistogram
T = valley between the 2 largest peaks in the histogram (per line in linear case).
Definition ReaderOptions.h:28
TextMode
Specify how the decoded byte content of a barcode should be transcoded to text.
Definition ReaderOptions.h:46
@ HRI
Human Readable Interpretation (dependent on the ContentType).
Definition ReaderOptions.h:49
@ Plain
bytes() transcoded to unicode based on ECI info or guessed charset (the default mode prior to 2....
Definition ReaderOptions.h:47
@ ECI
standard content following the ECI protocol with every character set ECI segment transcoded to unicod...
Definition ReaderOptions.h:48
@ Hex
bytes() transcoded to ASCII string of HEX values
Definition ReaderOptions.h:51
@ Escaped
Use the EscapeNonGraphical() function (e.g. ASCII 29 will be transcoded to "<GS>").
Definition ReaderOptions.h:50
@ HexECI
bytesECI() transcoded to ASCII string of HEX values
Definition ReaderOptions.h:52
EanAddOnSymbol
Definition ReaderOptions.h:34
@ Read
Read EAN-2/EAN-5 Add-On symbol if found.
Definition ReaderOptions.h:36
@ Require
Require EAN-2/EAN-5 Add-On symbol to be present.
Definition ReaderOptions.h:37
@ Ignore
Ignore any Add-On symbol during read/scan.
Definition ReaderOptions.h:35