CVB++ 15.0
reader_config.hpp
1#pragma once
2
3#include "../_cexports/c_barcode.h"
4#include "barcode.hpp"
5
6
7#include "_detail/config_base.hpp"
8#include "_detail/barcode_grading.hpp"
9#include "_detail/data_matrix_grading.hpp"
10#include "_detail/qr_grading.hpp"
11#include "_detail/qr.hpp"
12
13#include "_detail/codabar.hpp"
14#include "_detail/code11.hpp"
15#include "_detail/code32.hpp"
16#include "_detail/discrete_2_of_5.hpp"
17#include "_detail/ean8.hpp"
18#include "_detail/ean13.hpp"
19#include "_detail/four_state_australian.hpp"
20#include "_detail/four_state_kix.hpp"
21#include "_detail/four_state_royal_mail.hpp"
22#include "_detail/four_state_usps.hpp"
23#include "_detail/interleaved_2_of_5.hpp"
24#include "_detail/micro_pdf417.hpp"
25#include "_detail/msi_plessey.hpp"
26#include "_detail/pharma_code.hpp"
27#include "_detail/planet.hpp"
28#include "_detail/postnet.hpp"
29#include "_detail/rss.hpp"
30#include "_detail/upc_a.hpp"
31#include "_detail/upc_e.hpp"
32#include "_detail/pdf417.hpp"
33#include "_detail/data_matrix.hpp"
34#include "_detail/qr.hpp"
35#include "_detail/sony_code.hpp"
36#include "_detail/code128.hpp"
37#include "_detail/code39.hpp"
38#include "_detail/code93.hpp"
39
40
41#include <map>
42#include <typeinfo>
43#include <typeindex>
44
45
46namespace Cvb
47{
48 CVB_BEGIN_INLINE_NS
49
50 template <>
51 inline HandleGuard<Barcode::ReaderConfig>::HandleGuard(void * handle) noexcept
52 : HandleGuard<Barcode::ReaderConfig>(handle, [](void* handle) { CVB_CALL_CAPI(CvcBcDeleteConfiguration(reinterpret_cast<intptr_t>(handle))); })
53 {
54 }
55
56 namespace Barcode
57 {
59
63 {
64 public:
66 {
67 return Internal::DoResCallObjectOut<ReaderConfig>([&](void* & configOut)
68 {
69 configOut = reinterpret_cast<void*>(CVB_CALL_CAPI(CvcBcCreateConfiguration(SmartBool(initMode == ReaderInitialization::ReadAll))));
70 return CExports::CVC_E_OK;
71 });
72 }
73
74
76
80 void* Handle() const noexcept
81 {
82 return handle_.Handle();
83 }
84
85
87
95 static std::unique_ptr<ReaderConfig> FromHandle(HandleGuard<ReaderConfig>&& guard)
96 {
97 if (!guard.Handle())
98 throw std::runtime_error("handle must not be null");
99 return std::unique_ptr<ReaderConfig>(new ReaderConfig(std::move(guard)));
100 }
101
102
104
110 {
111 auto pConfig = Create(ReaderInitialization::ReadAll);
112 Internal::DoResCall([&]()
113 {
114 return CVB_CALL_CAPI(CvcBcLoadConfigurationTyped(reinterpret_cast<intptr_t>(pConfig->Handle()), fileName.c_str()));
115 });
116 pConfig->UpdateMap();
117 return pConfig;
118 }
119
120
122
128 void Save(Cvb::String fileName)
129 {
130 Flush();
131 Internal::DoResCall([&]()
132 {
133 return CVB_CALL_CAPI(CvcBcSaveConfigurationTyped(reinterpret_cast<intptr_t>(handle_.Handle()), fileName.c_str()));
134 });
135 }
136
137
139
142 void Flush()
143 {
144 for (auto pair : configMap_)
145 pair.second->WriteToHandle(true, handle_);
146 }
147
148
150
155 template<typename TConfig>
157 {
158 static_assert(std::is_base_of<Config::ConfigBase, TConfig>::value, "CVB: ConfigBase must be a base of T");
160 if (TrySearchConfiguration<TConfig>(pConfig))
161 return pConfig;
162 return nullptr;
163 }
164
165
167
173 template<typename TConfig>
175 {
176 if (auto config = Configuration<TConfig>())
177 return config;
178 else
179 {
180 auto& configId = typeid(TConfig);
181 if (auto FromHandle = TypeIdCtorMapping.at(configId))
182 {
183 bool isCurrentlyActive = false;
184 if (auto newConfig = FromHandle(handle_, isCurrentlyActive))
185 {
186 InsertConfiguration(configId, newConfig);
187 return std::dynamic_pointer_cast<TConfig>(newConfig);
188 }
189 throw std::runtime_error("Failed to create configuration");
190 }
191 throw std::runtime_error("Unknown barcode id. No matching typeid found");
192 }
193 }
194
195
196
197
199
204 template<typename TConfig>
206 {
207 static_assert(std::is_base_of<Config::ConfigBase, TConfig>::value, "CVB: ConfigBase must be a base of T");
208 RemoveConfiguration(typeid(TConfig));
209 }
210
211
212
213
215
220 void SetReadoutMode(Readout readoutMode)
221 {
222 readoutMode_ = readoutMode;
223 }
224
226
231 Readout ReadoutMode() const noexcept
232 {
233 return readoutMode_;
234 }
235
236
238
245 {
246 Internal::DoResCall([&]()
247 {
248 return CVB_CALL_CAPI(CvcBcSetReadout(reinterpret_cast<std::intptr_t>(handle_.Handle()),
249 static_cast<short>(OmniDirectionalReadoutAngleCount()),
250 static_cast<short>(OmniDirectionalReadoutStripeCount()),
251 static_cast<short>(range)));
252 });
253 }
254
255
257
263 int ReadoutStripeDistance() const noexcept
264 {
265 short numAngle = 0;
266 short numStripes = 0;
267 short range = 0;
268 CVB_CALL_CAPI(CvcBcGetReadout(reinterpret_cast<std::intptr_t>(handle_.Handle()), &numAngle, &numStripes, &range));
269 return static_cast<int>(range);
270 }
271
272
274
281 {
282 Internal::DoResCall([&]()
283 {
284 return CVB_CALL_CAPI(CvcBcSetReadout(reinterpret_cast<std::intptr_t>(handle_.Handle()),
285 static_cast<short>(numAngle),
286 static_cast<short>(OmniDirectionalReadoutStripeCount()),
287 static_cast<short>(ReadoutStripeDistance())));
288 });
289 }
290
291
293
300 {
301 short numAngle = 0;
302 short numStripes = 0;
303 short range = 0;
304 CVB_CALL_CAPI(CvcBcGetReadout(reinterpret_cast<std::intptr_t>(handle_.Handle()), &numAngle, &numStripes, &range));
305 return static_cast<int>(numAngle);
306 }
307
308
310
317 {
318 Internal::DoResCall([&]()
319 {
320 return CVB_CALL_CAPI(CvcBcSetReadout(reinterpret_cast<std::intptr_t>(handle_.Handle()),
321 static_cast<short>(OmniDirectionalReadoutAngleCount()),
322 static_cast<short>(numStripe),
323 static_cast<short>(ReadoutStripeDistance())));
324 });
325 }
326
327
329
336 {
337 short numAngle = 0;
338 short numStripes = 0;
339 short range = 0;
340 CVB_CALL_CAPI(CvcBcGetReadout(reinterpret_cast<std::intptr_t>(handle_.Handle()), &numAngle, &numStripes, &range));
341 return static_cast<int>(numStripes);
342 }
343
344
346
353 void SetCheckCodePosition(bool checkPosition)
354 {
355 Internal::DoResCall([&]()
356 {
357 return CVB_CALL_CAPI(CvcBcSetCodePositionCheck(reinterpret_cast<std::intptr_t>(handle_.Handle()), SmartBool(checkPosition)));
358 });
359 }
360
361
363
370 bool CheckCodePosition() const noexcept
371 {
372 SmartBool checkPosition(false);
373 CVB_CALL_CAPI(CvcBcGetCodePositionCheck(reinterpret_cast<std::intptr_t>(handle_.Handle()), checkPosition.Ptr()));
374 return checkPosition;
375 }
376
377
379
389 void SetTimeLimit(int timeLimit)
390 {
391 CVB_CALL_CAPI(CvcBcSetTimeLimit(reinterpret_cast<std::intptr_t>(handle_.Handle()), static_cast<short>(timeLimit)));
392 }
393
394
396
405 int TimeLimit() const noexcept
406 {
407 short timeLimit = 0;
408 CVB_CALL_CAPI(CvcBcGetTimeLimit(reinterpret_cast<std::intptr_t>(handle_.Handle()), &timeLimit));
409 return static_cast<int>(timeLimit);
410 }
411
412
414
419 bool ContainsSymbology(Symbology symbology) const
420 {
421 for (auto pair : TypeIdSymbologyMapping)
422 {
423 auto tmpSymbology = pair.second;
424 auto& tmpId = pair.first;
425 if (tmpSymbology == symbology)
426 if (configMap_.count(tmpId) >= 1)
427 return true;
428 else
429 return false;
430 }
431 return false;
432 }
433
434
435 private:
437
442 : handle_(reinterpret_cast<void*>(CVB_CALL_CAPI(CvcBcCreateConfiguration(SmartBool(initMode == ReaderInitialization::ReadAll)))))
443 , configMap_(ReaderConfig::InitConfigMap(handle_))
444 , readoutMode_(Readout::Omnidirectional)
445 {
446 }
447
448
449 ReaderConfig(HandleGuard<ReaderConfig>&& guard) noexcept
450 : handle_(std::move(guard))
451 {
452 readoutMode_ = Readout::Omnidirectional;
453 UpdateMap();
454 }
455
456 ReaderConfig(ReaderConfig && other) = default;
457
458 ReaderConfig & operator=(ReaderConfig && other) = default;
459
460
461 void UpdateMap()
462 {
463 configMap_ = InitConfigMap(handle_);
464 }
465
466
467 static std::map<std::type_index, ConfigBasePtr> InitConfigMap(HandleGuard<ReaderConfig>& guard)
468 {
470 for (auto pair : TypeIdCtorMapping)
471 {
472 auto& id = pair.first;
473 auto FromHandle = pair.second;
474 bool isActive = false;
475 auto pConfig = FromHandle(guard, isActive);
476 if (isActive)
477 tmpMap.insert(std::pair<std::type_index, ConfigBasePtr>(id, pConfig));
478 }
479 return tmpMap;
480 }
481
482
483 template<typename TConfig>
484 bool TrySearchConfiguration(std::shared_ptr<TConfig>& configOut)
485 {
486 try
487 {
488 for (auto const& pair : configMap_)
489 if (auto tmpConfig = std::dynamic_pointer_cast<TConfig>(pair.second))
490 {
491 configOut = tmpConfig;
492 return true;
493 }
494 }
495 catch (...)
496 {
497 return false;
498 }
499 return false;
500 }
501
502
503 void InsertConfiguration(std::type_index configId, ConfigBasePtr configuration)
504 {
505 if (configuration)
506 configMap_.insert(std::pair<std::type_index, ConfigBasePtr>(configId, configuration));
507 else
508 throw std::runtime_error("Failed to insert configuration - NULL pointer");
509 }
510
511
513 {
514 if (auto config = configMap_.at(configId))
515 {
516 config->WriteToHandle(false, handle_);
517 configMap_.erase(configId);
518 }
519 else
520 throw std::runtime_error("Failed to remove barcode symbology from configuration. Not available/active.");
521 }
522
523
524 private:
525 HandleGuard<ReaderConfig> handle_;
527
528 Readout readoutMode_;
529
530 static const std::map<std::type_index, std::function<ConfigBasePtr(const HandleGuard<ReaderConfig>&, bool&)> > TypeIdCtorMapping;
531 static const std::map<std::type_index, Symbology> TypeIdSymbologyMapping;
532 };
533
534 }
535 using Barcode::ReaderConfig;
536
537 CVB_END_INLINE_NS
538}
539
540
541const std::map<std::type_index, std::function<Cvb::Barcode::ConfigBasePtr(const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>&, bool&)> > Cvb::Barcode::ReaderConfig::TypeIdCtorMapping =
542{
543 { typeid(Cvb::Barcode::Codabar) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Codabar::FromHandle(guard, isActiveOut);} } ,
544 { typeid(Cvb::Barcode::Code11) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Code11::FromHandle(guard, isActiveOut);} } ,
545 { typeid(Cvb::Barcode::Code32) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Code32::FromHandle(guard, isActiveOut);} } ,
546 { typeid(Cvb::Barcode::Discrete2of5) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Discrete2of5::FromHandle(guard, isActiveOut);} } ,
547 { typeid(Cvb::Barcode::Ean8) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Ean8::FromHandle(guard, isActiveOut); } } ,
548 { typeid(Cvb::Barcode::Ean13) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Ean13::FromHandle(guard, isActiveOut); } } ,
549 { typeid(Cvb::Barcode::FourStateAustralian) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::FourStateAustralian::FromHandle(guard, isActiveOut);} } ,
550 { typeid(Cvb::Barcode::FourStateKix) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::FourStateKix::FromHandle(guard, isActiveOut);} } ,
551 { typeid(Cvb::Barcode::FourStateRoyalMail) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::FourStateRoyalMail::FromHandle(guard, isActiveOut);} } ,
552 { typeid(Cvb::Barcode::FourStateUsps) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::FourStateUsps::FromHandle(guard, isActiveOut);} } ,
553 { typeid(Cvb::Barcode::Interleaved2of5) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Interleaved2of5::FromHandle(guard, isActiveOut);} } ,
554 { typeid(Cvb::Barcode::MicroPdf417) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::MicroPdf417::FromHandle(guard, isActiveOut);} } ,
555 { typeid(Cvb::Barcode::MsiPlessey) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::MsiPlessey::FromHandle(guard, isActiveOut);} } ,
556 { typeid(Cvb::Barcode::PharmaCode) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::PharmaCode::FromHandle(guard, isActiveOut);} } ,
557 { typeid(Cvb::Barcode::Planet) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Planet::FromHandle(guard, isActiveOut);} } ,
558 { typeid(Cvb::Barcode::Postnet) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Postnet::FromHandle(guard, isActiveOut);} } ,
559 { typeid(Cvb::Barcode::Rss) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Rss::FromHandle(guard, isActiveOut);} } ,
560 { typeid(Cvb::Barcode::UpcA) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::UpcA::FromHandle(guard, isActiveOut);} } ,
561 { typeid(Cvb::Barcode::UpcE) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::UpcE::FromHandle(guard, isActiveOut);} } ,
562 { typeid(Cvb::Barcode::Pdf417) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Pdf417::FromHandle(guard, isActiveOut);} } ,
563 { typeid(Cvb::Barcode::DataMatrix) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::DataMatrix::FromHandle(guard, isActiveOut);} } ,
564 // PharmaCode2D has the same config like DataMaMatrix
565 { typeid(Cvb::Barcode::Qr) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Qr::FromHandle(guard, isActiveOut);} } ,
566 { typeid(Cvb::Barcode::SonyCode) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::SonyCode::FromHandle(guard, isActiveOut);} } ,
567 { typeid(Cvb::Barcode::Code128) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Code128::FromHandle(guard, isActiveOut);} } ,
568 { typeid(Cvb::Barcode::Code39) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Code39::FromHandle(guard, isActiveOut);} } ,
569 { typeid(Cvb::Barcode::Code93) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::Code93::FromHandle(guard, isActiveOut);} } ,
570 { typeid(Cvb::Barcode::QrGrading) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::QrGrading::FromHandle(guard, isActiveOut); } } ,
571 { typeid(Cvb::Barcode::DataMatrixGrading) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::DataMatrixGrading::FromHandle(guard, isActiveOut); } } ,
572 { typeid(Cvb::Barcode::BarcodeGrading) , [](const Cvb::HandleGuard<Cvb::Barcode::ReaderConfig>& guard, bool& isActiveOut) { return Cvb::Barcode::BarcodeGrading::FromHandle(guard, isActiveOut); } }
573};
574
575const std::map<std::type_index, Cvb::Barcode::Symbology> Cvb::Barcode::ReaderConfig::TypeIdSymbologyMapping =
576{
598 // PharmaCode2D has the same config like DataMatrix
607};
Configuration to access parameters of barcode grading.
Definition: barcode_grading.hpp:17
static std::unique_ptr< BarcodeGrading > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: barcode_grading.hpp:155
Configuration to access parameters of Codabar.
Definition: codabar.hpp:18
static std::unique_ptr< Codabar > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: codabar.hpp:30
Configuration to access parameters of Code11.
Definition: code11.hpp:17
static std::unique_ptr< Code11 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: code11.hpp:60
Configuration to access parameters of Code128.
Definition: code128.hpp:18
static std::unique_ptr< Code128 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: code128.hpp:31
Configuration to access parameters of Code32.
Definition: code32.hpp:17
static std::unique_ptr< Code32 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: code32.hpp:84
Configuration to access parameters of Code39.
Definition: code39.hpp:18
static std::unique_ptr< Code39 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: code39.hpp:60
Configuration to access parameters of Code93.
Definition: code93.hpp:18
static std::unique_ptr< Code93 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: code93.hpp:31
Configuration to access parameters of DataMatrixGrading.
Definition: data_matrix_grading.hpp:17
static std::unique_ptr< DataMatrixGrading > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: data_matrix_grading.hpp:58
Configuration to access parameters of DataMatrix.
Definition: data_matrix.hpp:18
static std::unique_ptr< DataMatrix > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: data_matrix.hpp:588
Configuration to access parameters of Discrete2of5.
Definition: discrete_2_of_5.hpp:17
static std::unique_ptr< Discrete2of5 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: discrete_2_of_5.hpp:30
Configuration to access parameters of Ean13.
Definition: ean13.hpp:17
static std::unique_ptr< Ean13 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: ean13.hpp:29
Configuration to access parameters of Ean8.
Definition: ean8.hpp:17
static std::unique_ptr< Ean8 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: ean8.hpp:29
Configuration to access parameters of FourStateAustralian (4-State Australian).
Definition: four_state_australian.hpp:17
static std::unique_ptr< FourStateAustralian > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: four_state_australian.hpp:85
Configuration to access parameters of FourStateKix.
Definition: four_state_kix.hpp:17
static std::unique_ptr< FourStateKix > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: four_state_kix.hpp:119
Configuration to access parameters of FourStateRoyalMail (4-State RoyalMail Postal Code).
Definition: four_state_royal_mail.hpp:18
static std::unique_ptr< FourStateRoyalMail > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: four_state_royal_mail.hpp:198
Configuration to access parameters of FourStateUsps.
Definition: four_state_usps.hpp:17
static std::unique_ptr< FourStateUsps > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: four_state_usps.hpp:59
Configuration to access parameters of Interleaved2of5.
Definition: interleaved_2_of_5.hpp:17
static std::unique_ptr< Interleaved2of5 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: interleaved_2_of_5.hpp:29
Configuration to access parameters of MicroPdf417.
Definition: micro_pdf417.hpp:17
static std::unique_ptr< MicroPdf417 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: micro_pdf417.hpp:60
Configuration to access parameters of MsiPlessey.
Definition: msi_plessey.hpp:18
static std::unique_ptr< MsiPlessey > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: msi_plessey.hpp:59
Configuration to access parameters of Pdf417.
Definition: pdf417.hpp:17
static std::unique_ptr< Pdf417 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: pdf417.hpp:179
Configuration to access parameters of PharmaCode.
Definition: pharma_code.hpp:18
static std::unique_ptr< PharmaCode > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: pharma_code.hpp:261
Configuration to access parameters of Planet.
Definition: planet.hpp:18
static std::unique_ptr< Planet > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: planet.hpp:61
Configuration to access parameters of Postnet.
Definition: postnet.hpp:17
static std::unique_ptr< Postnet > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: postnet.hpp:60
Configuration to access parameters of QrGrading.
Definition: qr_grading.hpp:17
static std::unique_ptr< QrGrading > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: qr_grading.hpp:107
Configuration to access parameters of Qr.
Definition: qr.hpp:18
static std::unique_ptr< Qr > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: qr.hpp:181
Contains a map of configurations for all active barcode types.
Definition: reader_config.hpp:63
int OmniDirectionalReadoutStripeCount() const noexcept
Get the absolute number of profile lines.
Definition: reader_config.hpp:335
int TimeLimit() const noexcept
This function returns the maximum evaluation time for the decoding of a barcode.
Definition: reader_config.hpp:405
void Flush()
Write all parameters to the handle.
Definition: reader_config.hpp:142
bool CheckCodePosition() const noexcept
This function returns the parameter for the Code Position Check.
Definition: reader_config.hpp:370
std::shared_ptr< TConfig > Configuration()
Returns an existing configuration in the object.
Definition: reader_config.hpp:156
void SetTimeLimit(int timeLimit)
This function sets the maximum evaluation time for the decoding of a barcode.
Definition: reader_config.hpp:389
static std::unique_ptr< ReaderConfig > FromHandle(HandleGuard< ReaderConfig > &&guard)
Creates reader config from a classic API handle.
Definition: reader_config.hpp:95
int ReadoutStripeDistance() const noexcept
Get the distance between lines in pixel.
Definition: reader_config.hpp:263
void RemoveConfiguration()
Removes a configuration from map.
Definition: reader_config.hpp:205
int OmniDirectionalReadoutAngleCount() const noexcept
Set the absolute number of profile rotations.
Definition: reader_config.hpp:299
void SetReadoutMode(Readout readoutMode)
Set the the readout mode.
Definition: reader_config.hpp:220
static std::unique_ptr< ReaderConfig > Load(const Cvb::String &fileName)
Reads the configuration data from file.
Definition: reader_config.hpp:109
void SetReadoutStripeDistance(int range)
Set the distance between lines in pixel.
Definition: reader_config.hpp:244
void SetOmniDirectionalReadoutStripeCount(int numStripe)
Set the absolute number of profile lines.
Definition: reader_config.hpp:316
void SetCheckCodePosition(bool checkPosition)
This function sets the parameter for the Code Position Check.
Definition: reader_config.hpp:353
Readout ReadoutMode() const noexcept
Access the readout mode.
Definition: reader_config.hpp:231
void * Handle() const noexcept
Returns C-API style handle to the reader config.
Definition: reader_config.hpp:80
bool ContainsSymbology(Symbology symbology) const
Check if the object contains the given symbology.
Definition: reader_config.hpp:419
std::shared_ptr< TConfig > CreateConfiguration()
Creates a new configuration for the object.
Definition: reader_config.hpp:174
void Save(Cvb::String fileName)
Writes the data of the configuration to file.
Definition: reader_config.hpp:128
void SetOmniDirectionalReadoutAngleCount(int numAngle)
Set the absolute number of profile rotations.
Definition: reader_config.hpp:280
Configuration to access parameters of Rss.
Definition: rss.hpp:18
static std::unique_ptr< Rss > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: rss.hpp:111
Configuration to access parameters of SonyCode.
Definition: sony_code.hpp:18
static std::unique_ptr< SonyCode > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: sony_code.hpp:60
Configuration to access parameters of UpcA.
Definition: upc_a.hpp:18
static std::unique_ptr< UpcA > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: upc_a.hpp:30
Configuration to access parameters of UpcE.
Definition: upc_e.hpp:17
static std::unique_ptr< UpcE > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: upc_e.hpp:28
@ CVC_E_OK
No Error occurred.
Definition: CVCError.h:58
Readout
Available readout modes.
Definition: barcode.hpp:72
@ Omnidirectional
Read a barcode no matter what the orientation of the bars is.
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:97
@ Code11
Code 11 Barcode.
@ Code128
Code 128 Barcode.
@ SonyCode
SonyCode Barcode.
@ Qr
QR Matrix Code.
@ Ean13
EAN 13 Barcode.
@ DataMatrixGrading
DataMatrix grading.
@ FourStateUsps
Four State USPS Barcode.
@ Codabar
Codabar Barcode.
@ FourStateRoyalMail
Four State Royal Mail Barcode.
@ FourStateKix
Four State KIX Barcode.
@ BarcodeGrading
1D Barcode grading
@ FourStateAustralian
Four State Australian Barcode.
@ Code39
Code 39 Barcode.
@ Code32
Code 32 Barcode.
@ Pdf417
PDF417 Matrix Code.
@ Planet
Planet Barcode.
@ Interleaved2of5
2 of 5 Interleaved Barcode
@ PharmaCode
PharmaCode Barcode.
@ Postnet
Postnet Barcode.
@ MicroPdf417
Micro PDF417 Matrix Code.
@ UpcA
UPC-A Barcode.
@ Ean8
EAN 8 Barcode.
@ Code93
Code 93 Barcode.
@ MsiPlessey
MSI Plessey Barcode.
@ QrGrading
QR code grading.
@ DataMatrix
Data Matrix Code.
@ Discrete2of5
2 of 5 Discrete Barcode
@ UpcE
UPC-E Barcode.
ReaderInitialization
Possible ways to initialize a Barcode reader.
Definition: barcode.hpp:88
@ ReadAll
Initialize the reader to read all codes.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24