CVB++ 15.0
upc_e.hpp
1#pragma once
2
3#include "reader_ean_upc_config_base.hpp"
4
5namespace Cvb
6{
7 CVB_BEGIN_INLINE_NS
8
9 namespace Barcode
10 {
11 using namespace Internal;
12
14
17 {
18 public:
19 virtual Symbology Type() const override { return Symbology::UpcE; };
20
22
28 static std::unique_ptr<UpcE> FromHandle(const HandleGuard<ReaderConfig>& guard, bool& isActiveOut)
29 {
30 auto pConfig = std::unique_ptr<UpcE>(new UpcE());
31 isActiveOut = pConfig->ReadFromHandle(guard);
32 return pConfig;
33 }
34
35 protected:
36 virtual bool ReadFromHandle_(const HandleGuard<ReaderConfig>& guard) override
37 {
38 CExports::cvbbool_t active;
39 CVB_CALL_CAPI(CvcBcGetUPCE(reinterpret_cast<std::intptr_t>(guard.Handle()),
40 &active,
41 checkQuietzone_.Ptr(),
42 appendix2Present_.Ptr(),
43 appendix5Present_.Ptr(),
44 inverse_.Ptr()
45 ));
46 return SmartBool(active);
47 }
48
49 virtual void WriteToHandle_(bool active, HandleGuard<ReaderConfig>& guard) override
50 {
51 CVB_CALL_CAPI(CvcBcSetUPCE(reinterpret_cast<std::intptr_t>(guard.Handle()),
52 SmartBool(active),
53 checkQuietzone_,
54 appendix2Present_,
55 appendix5Present_,
56 inverse_
57 ));
58 }
59 protected:
60 UpcE()
61 : ReaderEanUpcConfigBase()
62 {
63 }
64
65 };
66
67 using UpcEPtr = std::shared_ptr<UpcE>;
68 }
69
70 CVB_END_INLINE_NS
71}
Configuration to access parameters of ReaderEanUpcConfigBase.
Definition: reader_ean_upc_config_base.hpp:20
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
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:97
@ UpcE
UPC-E Barcode.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24