CVB++ 14.0
reader_four_state_config_base.hpp
1#pragma once
2
3#include "reader_config_base.hpp"
4
5namespace Cvb
6{
7 CVB_BEGIN_INLINE_NS
8
9 namespace Barcode
10 {
11 using namespace Internal;
12
13 namespace Config
14 {
15
17
20 {
21 public:
22
24
29 void SetMirrored(bool mirrored)
30 {
31 if (mirrored_ != mirrored)
32 SetDirty();
33 mirrored_ = mirrored;
34 };
35
37
42 bool Mirrored() const
43 {
44 return mirrored_;
45 };
46
48
53 void SetQuietzoneWidth(int quietzoneWidth)
54 {
55 if (quietzoneWidth < 2 || quietzoneWidth > 10)
56 throw std::runtime_error("Quietzone width out of range [2,10]");
57 if (quietzoneWidth_ != static_cast<short>(quietzoneWidth))
58 SetDirty();
59 quietzoneWidth_ = static_cast<short>(quietzoneWidth);
60 }
61
63
68 int QuietzoneWidth() const
69 {
70 return quietzoneWidth_;
71 };
72
73
75
80 void SetThreshold(int threshold)
81 {
82 if (threshold < 0 || threshold > 100)
83 throw std::runtime_error("Threshold out of range [0,100]");
84 if (threshold_ != static_cast<short>(threshold))
85 SetDirty();
86 threshold_ = static_cast<short>(threshold);
87 }
88
90
95 int Threshold() const
96 {
97 return threshold_;
98 };
99
100 protected:
101 SmartBool mirrored_;
102 short quietzoneWidth_;
103 short threshold_;
104
105 protected:
108 {
109 }
110
111 };
112 }
113
114 using ReaderFourStateConfigBase = Config::ReaderFourStateConfigBase;
115 using ReaderFourStateConfigBasePtr = std::shared_ptr<ReaderFourStateConfigBase>;
116
117 }
118
119 CVB_END_INLINE_NS
120}
Configuration to access parameters of ReaderConfigBase.
Definition: reader_config_base.hpp:20
Configuration to access parameters of ReaderFourStateConfigBase.
Definition: reader_four_state_config_base.hpp:20
bool Mirrored() const
Returns whether the code is mirrored/not mirrored.
Definition: reader_four_state_config_base.hpp:42
void SetMirrored(bool mirrored)
Sets whether the code is mirrored/not mirrored.
Definition: reader_four_state_config_base.hpp:29
int QuietzoneWidth() const
Returns the quiet zone in module width.
Definition: reader_four_state_config_base.hpp:68
void SetQuietzoneWidth(int quietzoneWidth)
Sets the quiet zone in module width.
Definition: reader_four_state_config_base.hpp:53
void SetThreshold(int threshold)
Sets the digitalisation threshold in percent, ranging from 0 to 100.
Definition: reader_four_state_config_base.hpp:80
int Threshold() const
Returns the digitalisation threshold in percent, ranging from 0 to 100.
Definition: reader_four_state_config_base.hpp:95
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24