CVB++ 14.0
reader_planet_postnet_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 SetEvaluateCheckDigit(bool evalCheckDigit)
30 {
31 SetDirty();
32 evalCheckDigit_ = evalCheckDigit;
33 };
34
36
41 bool EvaluateCheckDigit() const
42 {
43 return evalCheckDigit_;
44 };
45
46
48
53 void SetMirrored(bool mirrored)
54 {
55 SetDirty();
56 mirrored_ = mirrored;
57 };
58
60
65 bool Mirrored() const
66 {
67 return mirrored_;
68 };
69
70
72
78 {
79 if (orientation_ != orientation)
80 SetDirty();
81 orientation_ = orientation;
82 }
83
85
91 {
92 return orientation_;
93 };
94
95
97
102 void SetQuietzoneWidth(int quietzoneWidth)
103 {
104 if (quietzoneWidth < 2 || quietzoneWidth > 10)
105 throw std::runtime_error("Quietzone width out of range [2,10]");
106 if (quietzoneWidth_ != static_cast<short>(quietzoneWidth))
107 SetDirty();
108 quietzoneWidth_ = static_cast<short>(quietzoneWidth);
109 }
110
112
117 int QuietzoneWidth() const
118 {
119 return quietzoneWidth_;
120 };
121
123
128 void SetThreshold(int threshold)
129 {
130 if (threshold < 0 || threshold > 100)
131 throw std::runtime_error("Threshold out of range [0,100]");
132 if (threshold_ != static_cast<short>(threshold))
133 SetDirty();
134 threshold_ = static_cast<short>(threshold);
135 }
136
138
143 int Threshold() const
144 {
145 return threshold_;
146 };
147
148
150
155 void SetTransmitCheckDigit(bool transmitCheckDigit)
156 {
157 SetDirty();
158 transmitCheckDigit_ = transmitCheckDigit;
159 };
160
162
168 {
169 return transmitCheckDigit_;
170 };
171
172
173 protected:
174 SmartBool evalCheckDigit_;
175 SmartBool mirrored_;
176 CodeOrientation orientation_;
177 short quietzoneWidth_;
178 short threshold_;
179 SmartBool transmitCheckDigit_;
180
181 protected:
184 {
185 }
186
187 };
188 }
189 using ReaderPlanetPostnetConfigBase = Config::ReaderPlanetPostnetConfigBase;
190 using ReaderPlanetPostnetConfigBasePtr = std::shared_ptr<ReaderPlanetPostnetConfigBase>;
191 }
192
193 CVB_END_INLINE_NS
194}
Configuration to access parameters of ReaderConfigBase.
Definition: reader_config_base.hpp:20
Configuration to access parameters of ReaderPlanetPostnetConfigBase.
Definition: reader_planet_postnet_config_base.hpp:20
bool Mirrored() const
Returns whether the code is mirrored/not mirrored.
Definition: reader_planet_postnet_config_base.hpp:65
bool EvaluateCheckDigit() const
Returns the evaluate/ignore check digit.
Definition: reader_planet_postnet_config_base.hpp:41
CodeOrientation Orientation() const
Returns the orientation of the code in the image.
Definition: reader_planet_postnet_config_base.hpp:90
void SetMirrored(bool mirrored)
Sets whether the code is mirrored/not mirrored.
Definition: reader_planet_postnet_config_base.hpp:53
void SetTransmitCheckDigit(bool transmitCheckDigit)
Append/do not append check digit to data.
Definition: reader_planet_postnet_config_base.hpp:155
int QuietzoneWidth() const
Returns the quiet zone in module width. Possible values ranging from 2 to 10. Normally,...
Definition: reader_planet_postnet_config_base.hpp:117
void SetOrientation(CodeOrientation orientation)
Specifies the orientation of the code in the image.
Definition: reader_planet_postnet_config_base.hpp:77
void SetQuietzoneWidth(int quietzoneWidth)
Sets the quiet zone in module width. Possible values ranging from 2 to 10. Normally,...
Definition: reader_planet_postnet_config_base.hpp:102
void SetThreshold(int threshold)
Sets the threshold between bar and gap in the code.
Definition: reader_planet_postnet_config_base.hpp:128
int Threshold() const
Returns the threshold between bar and gap in the code.
Definition: reader_planet_postnet_config_base.hpp:143
bool TransmitCheckDigit() const
Returns whether to append check digit to data.
Definition: reader_planet_postnet_config_base.hpp:167
void SetEvaluateCheckDigit(bool evalCheckDigit)
Sets the evaluate/ignore check digit.
Definition: reader_planet_postnet_config_base.hpp:29
CodeOrientation
Directions that a four state code may have.
Definition: barcode.hpp:190
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24