CVB++ 14.0
rss.hpp
1#pragma once
2
3#include "reader_2d_config_base.hpp"
4
5namespace Cvb
6{
7 CVB_BEGIN_INLINE_NS
8
9 namespace Barcode
10 {
11 using namespace Internal;
12
13
15
17 class Rss : public Reader2DConfigBase
18 {
19public:
20
22
28 {
29 if(composition_ != composition)
30 SetDirty();
31 composition_ = composition;
32 }
33
35
41 {
42 return composition_;
43 }
44
45
47
53 {
54 if(orientation_ != orientation)
55 SetDirty();
56 orientation_ = orientation;
57 }
58
60
66 {
67 return orientation_;
68 }
69
71
76 void SetTypes(RssTypes types)
77 {
78 if(types_ != types)
79 SetDirty();
80 types_ = types;
81 }
82
84
90 {
91 return types_;
92 };
93
94
95 protected:
96 RssComposition composition_;
97 CodeOrientation orientation_;
98 RssTypes types_;
99
100
101 public:
102 virtual Symbology Type() const override { return Symbology::RSS; };
103
105
111 static std::unique_ptr<Rss> FromHandle(const HandleGuard<ReaderConfig>& guard, bool& isActiveOut)
112 {
113 auto pConfig = std::unique_ptr<Rss>(new Rss());
114 isActiveOut = pConfig->ReadFromHandle(guard);
115 return pConfig;
116 }
117
118 protected:
119 virtual bool ReadFromHandle_(const HandleGuard<ReaderConfig>& guard) override
120 {
121 CExports::cvbbool_t active;
122 short tmpTypes;
123 short tmpComposite;
124 short tmpDirection;
125 CVB_CALL_CAPI(CvcBcGetRSS(reinterpret_cast<std::intptr_t>(guard.Handle()), &active,
126 inverse_.Ptr(),
127 mirrored_.Ptr(),
128 &tmpTypes,
129 &tmpComposite,
130 &tmpDirection));
131 types_ = static_cast<RssTypes>(tmpTypes);
132 composition_ = static_cast<RssComposition>(tmpComposite);
133 orientation_ = static_cast<CodeOrientation>(tmpDirection);
134 return SmartBool(active);
135 }
136
137 virtual void WriteToHandle_(bool active, HandleGuard<ReaderConfig>& guard) override
138 {
139 Internal::DoResCall([&]()
140 {
141 return CVB_CALL_CAPI(CvcBcSetRSS(reinterpret_cast<std::intptr_t>(guard.Handle()),
142 SmartBool(active),
143 inverse_,
144 mirrored_,
145 static_cast<short>(types_),
146 static_cast<short>(composition_),
147 static_cast<short>(orientation_)));
148 });
149 }
150 protected:
151 Rss()
152 : Reader2DConfigBase()
153 {
154 }
155
156 };
157
158 using RssPtr = std::shared_ptr<Rss>;
159 }
160
161 CVB_END_INLINE_NS
162}
Configuration to access parameters of Reader2DConfigBase.
Definition: reader_2d_config_base.hpp:19
Configuration to access parameters of Rss.
Definition: rss.hpp:18
RssTypes Types() const
Returns the RSS types.
Definition: rss.hpp:89
RssComposition Composition() const
Returns the bit field which specifies the permitted RSS composite components.
Definition: rss.hpp:40
CodeOrientation Orientation() const
Returns the possible orientations in which the RSS code may occur.
Definition: rss.hpp:65
static std::unique_ptr< Rss > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: rss.hpp:111
void SetOrientation(CodeOrientation orientation)
Selects the possible orientations in which the RSS code may occur.
Definition: rss.hpp:52
void SetComposition(RssComposition composition)
Sets the bit field which specifies the permitted RSS composite components.
Definition: rss.hpp:27
void SetTypes(RssTypes types)
Sets the RSS types.
Definition: rss.hpp:76
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:97
RssComposition
Composition flags for RSS codes.
Definition: barcode.hpp:428
RssTypes
Types of RSS codes to read.
Definition: barcode.hpp:407
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