20#define ZX_BCF_LIST(X) \
21 X(None, 0 , 0, " ", 0, 1, "None") \
22 X(All, '*', '*', " ", 0, 1, "All") \
23 X(AllReadable, '*', 'r', " ", 0, 1, "All Readable") \
24 X(AllCreatable, '*', 'w', " ", 0, 1, "All Creatable") \
25 X(AllLinear, '*', 'l', " ", 0, 1, "All Linear") \
26 X(AllMatrix, '*', 'm', " ", 0, 1, "All Matrix") \
27 X(AllGS1, '*', 'G', " ", 0, 1, "All GS1") \
28 X(AllRetail, '*', 'R', " ", 0, 1, "All Retail") \
29 X(AllIndustrial, '*', 'I', " ", 0, 1, "All Industrial") \
30 X(Codabar, 'F', ' ', "lrw ", 18, ZXING_ENABLE_1D, "Codabar") \
31 X(Code39, 'A', ' ', "lrw I", 8, ZXING_ENABLE_1D, "Code 39") \
32 X(Code39Std, 'A', 's', "lrw I", 8, ZXING_ENABLE_1D, "Code 39 Standard") \
33 X(Code39Ext, 'A', 'e', "lr I", 9, ZXING_ENABLE_1D, "Code 39 Extended") \
34 X(Code32, 'A', '2', "lr I", 129, ZXING_ENABLE_1D, "Code 32") \
35 X(PZN, 'A', 'p', "lr I", 52, ZXING_ENABLE_1D, "Pharmazentralnummer") \
36 X(Code93, 'G', ' ', "lrw I", 25, ZXING_ENABLE_1D, "Code 93") \
37 X(Code128, 'C', ' ', "lrwGI", 20, ZXING_ENABLE_1D, "Code 128") \
38 X(ITF, 'I', ' ', "lrw I", 3, ZXING_ENABLE_1D, "ITF") \
39 X(ITF14, 'I', '4', "lr I", 89, ZXING_ENABLE_1D, "ITF-14") \
40 X(DataBar, 'e', ' ', "lr GR", 29, ZXING_ENABLE_1D, "DataBar") \
41 X(DataBarOmni, 'e', 'o', "lr GR", 29, ZXING_ENABLE_1D, "DataBar Omni") \
42 X(DataBarStk, 'e', 's', "lr GR", 79, ZXING_ENABLE_1D, "DataBar Stacked") \
43 X(DataBarStkOmni, 'e', 'O', "lr GR", 80, ZXING_ENABLE_1D, "DataBar Stacked Omni") \
44 X(DataBarLtd, 'e', 'l', "lr GR", 30, ZXING_ENABLE_1D, "DataBar Limited") \
45 X(DataBarExp, 'e', 'e', "lr GR", 31, ZXING_ENABLE_1D, "DataBar Expanded") \
46 X(DataBarExpStk, 'e', 'E', "lr GR", 81, ZXING_ENABLE_1D, "DataBar Expanded Stacked") \
47 X(EANUPC, 'E', ' ', "lr R", 15, ZXING_ENABLE_1D, "EAN/UPC") \
48 X(EAN13, 'E', '1', "lrw R", 15, ZXING_ENABLE_1D, "EAN-13") \
49 X(EAN8, 'E', '8', "lrw R", 10, ZXING_ENABLE_1D, "EAN-8") \
50 X(EAN5, 'E', '5', "l R", 12, ZXING_ENABLE_1D, "EAN-5") \
51 X(EAN2, 'E', '2', "l R", 11, ZXING_ENABLE_1D, "EAN-2") \
52 X(ISBN, 'E', 'i', "lr R", 69, ZXING_ENABLE_1D, "ISBN") \
53 X(UPCA, 'E', 'a', "lrw R", 34, ZXING_ENABLE_1D, "UPC-A") \
54 X(UPCE, 'E', 'e', "lrw R", 37, ZXING_ENABLE_1D, "UPC-E") \
55 X(OtherBarcode, 'X', ' ', " r ", 0, ZXING_ENABLE_1D, "Other barcode") \
56 X(DXFilmEdge, 'X', 'x', "lr ", 147, ZXING_ENABLE_1D, "DX Film Edge") \
57 X(PDF417, 'L', ' ', "mrw ", 55, ZXING_ENABLE_PDF417, "PDF417") \
58 X(CompactPDF417, 'L', 'c', "mr ", 56, ZXING_ENABLE_PDF417, "Compact PDF417") \
59 X(MicroPDF417, 'L', 'm', "m ", 84, ZXING_ENABLE_PDF417, "MicroPDF417") \
60 X(Aztec, 'z', ' ', "mr G ", 92, ZXING_ENABLE_AZTEC, "Aztec") \
61 X(AztecCode, 'z', 'c', "mrwG ", 92, ZXING_ENABLE_AZTEC, "Aztec Code") \
62 X(AztecRune, 'z', 'r', "mr ", 128, ZXING_ENABLE_AZTEC, "Aztec Rune") \
63 X(QRCode, 'Q', ' ', "mrwG ", 58, ZXING_ENABLE_QRCODE, "QR Code") \
64 X(QRCodeModel1, 'Q', '1', "mr ", 0, ZXING_ENABLE_QRCODE, "QR Code Model 1") \
65 X(QRCodeModel2, 'Q', '2', "mr ", 58, ZXING_ENABLE_QRCODE, "QR Code Model 2") \
66 X(MicroQRCode, 'Q', 'm', "mr ", 97, ZXING_ENABLE_QRCODE, "Micro QR Code") \
67 X(RMQRCode, 'Q', 'r', "mr G ", 145, ZXING_ENABLE_QRCODE, "rMQR Code") \
68 X(DataMatrix, 'd', ' ', "mrwG ", 71, ZXING_ENABLE_DATAMATRIX, "Data Matrix") \
69 X(MaxiCode, 'U', ' ', "mr ", 57, ZXING_ENABLE_MAXICODE, "MaxiCode") \
73#define ZX_BCF_ID(SYM, VAR) (((uint8_t)(SYM) << 0) | ((uint8_t)(VAR) << 8))
99#define ZX_(NAME, SYM, VAR, FLAGS, ZINT, ENABLED, HRI) NAME = ZX_BCF_ID(SYM, VAR),
103 DataBarExpanded [[deprecated(
"Use DataBarExp instead")]] =
DataBarExp,
104 DataBarLimited [[deprecated(
"Use DataBarLtd instead")]] =
DataBarLtd,
105 LinearCodes [[deprecated(
"Use AllLinear instead")]] =
AllLinear,
106 MatrixCodes [[deprecated(
"Use AllMatrix instead")]] =
AllMatrix,
107 Any [[deprecated(
"Use All instead")]] =
All,
114 return uint32_t(format) & 0xFF;
119 return (uint32_t(format) >> 8) & 0xFF;
124 return {
']', SymbologyKey(format), VariantKey(format)};
140template <std::
size_t N>
148template <std::
size_t N>
152 for (std::size_t i = 0; i < N; ++i)
158template <std::
size_t N>
161 return std::any_of(rhs.begin(), rhs.end(), [lhs](
BarcodeFormat bt) { return lhs & bt; });
183 std::vector<BarcodeFormat> formats_;
195 template <std::
size_t N>
201 BarcodeFormats(std::vector<BarcodeFormat>&& formats) : formats_(std::move(formats)) { normalize(); }
214 auto begin() const noexcept {
return formats_.cbegin(); }
215 auto end() const noexcept {
return formats_.cend(); }
217 using value_type =
typename std::vector<BarcodeFormat>::value_type;
218 using pointer =
typename std::vector<BarcodeFormat>::pointer;
219 auto data() const noexcept {
return formats_.data(); }
221 bool empty() const noexcept {
return formats_.empty(); }
222 int size() const noexcept {
return static_cast<int>(formats_.size()); }
235 [[deprecated]]
inline int count() const noexcept {
return size(); }
236 [[deprecated]]
inline bool testFlag(
BarcodeFormat format)
const noexcept
240 [[deprecated]]
inline bool testFlags(
const BarcodeFormats& formats)
const noexcept
243 return std::any_of(formats.begin(), formats.end(), [fo](
BarcodeFormat fi) { return fo & fi; });
bool operator<=(BarcodeFormat e, BarcodeFormat s)
Test if left hand side (e == element) is 'inside' right hand side (s == set) (e.g....
BarcodeFormat BarcodeFormatFromString(std::string_view str)
Parse a string into a BarcodeFormat. '-', '_', '/' and ' ' are optional.
BarcodeFormats BarcodeFormatsFromString(std::string_view str)
Parses a string into a set of BarcodeFormats. Separators can be (any combination of) '|' or ',...
constexpr BarcodeFormatArray< 2 > operator|(BarcodeFormat a, BarcodeFormat b)
Definition BarcodeFormat.h:143
BarcodeFormat Symbology(BarcodeFormat format)
Returns the symbology (base type) of the given barcode format (e.g. EAN/UPC for EAN13,...
std::string ToString(BarcodeFormat format)
std::string_view Name(BarcodeFormat format)
Returns the human-readable name of the given barcode format.
BarcodeFormat
Enumerates barcode formats known to this package.
Definition BarcodeFormat.h:98
@ AllLinear
Definition BarcodeFormat.h:100
@ AllMatrix
Definition BarcodeFormat.h:100
@ DataBarLtd
Definition BarcodeFormat.h:100
@ All
Definition BarcodeFormat.h:100
@ DataBarExp
Definition BarcodeFormat.h:100
std::array< BarcodeFormat, N > BarcodeFormatArray
Definition BarcodeFormat.h:141
bool operator&(BarcodeFormat a, BarcodeFormat b)
Test if the two BarcodeFormats have a non-empty intersection (e.g. AllMatrix & QRCode).