CVB++ 15.0
decl_config_base.hpp
1#pragma once
2
3#include "../../value_range.hpp"
4#include "../../_cexports/c_code_reader.h"
5
6namespace Cvb
7{
8 CVB_BEGIN_INLINE_NS
9
10 namespace CodeReader
11 {
12 class Decoder;
13
15
34 enum class Symbology
35 {
39
42 DataMatrix = CExports::CVCRSymbologies::CVCRS_DataMatrix,
44
47 QR = CExports::CVCRSymbologies::CVCRS_QR,
49
52 MicroQR = CExports::CVCRSymbologies::CVCRS_MicroQR,
54
57 Ean13 = CExports::CVCRSymbologies::CVCRS_EAN13,
59
62 Ean8 = CExports::CVCRSymbologies::CVCRS_EAN8,
64
67 UpcA = CExports::CVCRSymbologies::CVCRS_UPCA,
69
72 UpcE = CExports::CVCRSymbologies::CVCRS_UPCE,
74
77 Code128 = CExports::CVCRSymbologies::CVCRS_Code128,
79
82 Code39 = CExports::CVCRSymbologies::CVCRS_Code39,
84
87 Code93 = CExports::CVCRSymbologies::CVCRS_Code93,
89
92 Interleaved2of5 = CExports::CVCRSymbologies::CVCRS_Interleaved2of5,
94
97 Pdf417 = CExports::CVCRSymbologies::CVCRS_PDF417,
99
102 MicroPdf417 = CExports::CVCRSymbologies::CVCRS_MicroPDF417,
104
107 Pharmacode = CExports::CVCRSymbologies::CVCRS_Pharmacode,
109
112 Code32 = CExports::CVCRSymbologies::CVCRS_Code32,
114
117 Code11 = CExports::CVCRSymbologies::CVCRS_Code11,
119
122 AustraliaPost = CExports::CVCRSymbologies::CVCRS_AustralianPost,
124
127 DutchPost = CExports::CVCRSymbologies::CVCRS_DutchPost,
129
132 RoyalMail = CExports::CVCRSymbologies::CVCRS_RoyalMail,
134
137 UspsIntelligentMail = CExports::CVCRSymbologies::CVCRS_USPSIntelligentMail,
139
142 GS1DataBar14 = CExports::CVCRSymbologies::CVCRS_GS1DataBar14,
144
147 GS1DataBarStacked = CExports::CVCRSymbologies::CVCRS_GS1DataBarStacked,
149
152 GS1DataBarLimited = CExports::CVCRSymbologies::CVCRS_GS1DataBarLimited,
154
157 GS1DataBarExpanded = CExports::CVCRSymbologies::CVCRS_GS1DataBarExpanded,
159
162 GS1DataBarExpandedStacked = CExports::CVCRSymbologies::CVCRS_GS1DataBarExpandedStacked
163 };
164
166
180 namespace Config
181 {
183 enum class Polarity
184 {
191 };
192
195 {
197 None = 0,
202 };
203
205
209 template <class T>
210 class ConfigBase
211 {
212 friend class Cvb::CodeReader::Decoder;
213
214 public:
216
219 bool Enabled() const;
220
222
235 T &Enable();
236
238
241 T &Disable();
242
243 virtual ~ConfigBase() = default;
244
245 protected:
246 T &SetIntProperty(int property, int value);
247 int GetIntProperty(int property) const;
248
249 ConfigBase(Decoder &decoder) noexcept
250 : decoder_(decoder)
251 {
252 }
253 ConfigBase(ConfigBase &&other) = default;
254 ConfigBase &operator=(ConfigBase &&other) = default;
255
256 Decoder &decoder_;
257 };
258
259 template <Symbology S>
260 struct Mapper;
261
262 template <class C>
263 struct ReverseMapper;
264
266
287 template <class T>
288 class CompositeCodeBase : public ConfigBase<T>
289 {
290 protected:
291 using ConfigBase<T>::ConfigBase;
292
293 public:
295
298 bool EnabledCCA() const;
299
301
306 virtual T &EnableCCA();
307
309
314 virtual T &DisableCCA();
315
317
320 bool EnabledCCB() const;
321
323
328 virtual T &EnableCCB();
329
331
336 virtual T &DisableCCB();
337
339
342 bool EnabledCCC() const;
343
345
350 virtual T &EnableCCC();
351
353
358 virtual T &DisableCCC();
359 };
360
361 } // namespace Config
362 } // namespace CodeReader
363
364 CVB_END_INLINE_NS
365} // namespace Cvb
Base configuration class for composite codes.
Definition decl_config_base.hpp:289
bool EnabledCCC() const
Checks if CompositeComponent C (CC-C) decoding is enabled.
Definition detail_config_base.hpp:87
virtual T & EnableCCB()
Enables CompositeComponent B (CC-B) decoding.
Definition detail_config_base.hpp:75
virtual T & DisableCCB()
Disables CompositeComponent B (CC-B) decoding.
Definition detail_config_base.hpp:81
virtual T & EnableCCA()
Enables CompositeComponent A (CC-A) decoding.
Definition detail_config_base.hpp:57
virtual T & DisableCCA()
Disables CompositeComponent A (CC-A) decoding.
Definition detail_config_base.hpp:63
bool EnabledCCA() const
Checks if CompositeComponent A (CC-A) decoding is enabled.
Definition detail_config_base.hpp:51
virtual T & EnableCCC()
Enables CompositeComponent C (CC-C) decoding.
Definition detail_config_base.hpp:93
virtual T & DisableCCC()
Disables CompositeComponent C (CC-C) decoding.
Definition detail_config_base.hpp:99
bool EnabledCCB() const
Checks if CompositeComponent B (CC-B) decoding is enabled.
Definition detail_config_base.hpp:69
T & Enable()
Enables decoding for the code type represented by the derived class.
Definition detail_config_base.hpp:16
T & Disable()
Disables decoding for the code type represented by the derived class.
Definition detail_config_base.hpp:22
bool Enabled() const
Checks if decoding for the code type represented by the derived class is enabled.
Definition detail_config_base.hpp:28
Class for decoding.
Definition decl_decoder.hpp:101
Polarity
Enumeration of code polarity options for 2D codes.
Definition decl_config_base.hpp:184
@ DarkOnLight
Definition decl_config_base.hpp:186
@ Either
Definition decl_config_base.hpp:190
@ LightOnDark
Definition decl_config_base.hpp:188
RectangularDecoding
Enumeration for rectangular decoding modes for DataMatrix codes.
Definition decl_config_base.hpp:195
@ Simple
Definition decl_config_base.hpp:199
@ None
Definition decl_config_base.hpp:197
@ Extended
Definition decl_config_base.hpp:201
Namespace for all decoding functionalities.
Definition decl_config_2d_codes.hpp:10
Symbology
Enum class listing all supported symbologies.
Definition decl_config_base.hpp:35
@ Code11
Code 11.
Definition decl_config_base.hpp:117
@ AustraliaPost
Australia Post.
Definition decl_config_base.hpp:122
@ Code128
Code 128.
Definition decl_config_base.hpp:77
@ GS1DataBarStacked
GS1 DataBar Stacked.
Definition decl_config_base.hpp:147
@ MicroQR
Micro QR code.
Definition decl_config_base.hpp:52
@ RoyalMail
RoyalMail 4-State Code.
Definition decl_config_base.hpp:132
@ GS1DataBarExpandedStacked
GS1 DataBar Expanded Stacked.
Definition decl_config_base.hpp:162
@ Ean13
EAN-13.
Definition decl_config_base.hpp:57
@ GS1DataBarExpanded
GS1 DataBar Expanded.
Definition decl_config_base.hpp:157
@ QR
QR code.
Definition decl_config_base.hpp:47
@ Pharmacode
Pharmacode.
Definition decl_config_base.hpp:107
@ Unknown
Unknown symbology.
Definition decl_config_base.hpp:37
@ Code39
Code 39.
Definition decl_config_base.hpp:82
@ Code32
Code 32 (Italian Pharmacode).
Definition decl_config_base.hpp:112
@ Pdf417
PDF417.
Definition decl_config_base.hpp:97
@ Interleaved2of5
Interleaved 2 of 5.
Definition decl_config_base.hpp:92
@ DutchPost
DutchPost (KIX Code).
Definition decl_config_base.hpp:127
@ UspsIntelligentMail
USPS Intelligent Mail.
Definition decl_config_base.hpp:137
@ MicroPdf417
MicroPDF417.
Definition decl_config_base.hpp:102
@ UpcA
UPC-A.
Definition decl_config_base.hpp:67
@ Ean8
EAN-8.
Definition decl_config_base.hpp:62
@ GS1DataBarLimited
GS1 DataBar Limited.
Definition decl_config_base.hpp:152
@ GS1DataBar14
GS1 DataBar-14.
Definition decl_config_base.hpp:142
@ Code93
Code 93.
Definition decl_config_base.hpp:87
@ DataMatrix
Data Matrix.
Definition decl_config_base.hpp:42
@ UpcE
UPC-E.
Definition decl_config_base.hpp:72
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17