CVB++ 14.0
ean8.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
19 public:
20 virtual Symbology Type() const override { return Symbology::Ean8; }
21
23
29 static std::unique_ptr<Ean8> FromHandle(const HandleGuard<ReaderConfig>& guard, bool& isActiveOut)
30 {
31 auto pConfig = std::unique_ptr<Ean8>(new Ean8());
32 isActiveOut = pConfig->ReadFromHandle(guard);
33 return pConfig;
34 }
35
36 protected:
37 virtual bool ReadFromHandle_(const HandleGuard<ReaderConfig>& guard) override
38 {
39 CExports::cvbbool_t active;
40 CVB_CALL_CAPI(CvcBcGetEAN8(reinterpret_cast<std::intptr_t>(guard.Handle()),
41 &active,
42 checkQuietzone_.Ptr(),
43 appendix2Present_.Ptr(),
44 appendix5Present_.Ptr(),
45 inverse_.Ptr()
46 ));
47 return SmartBool(active);
48 }
49
50 virtual void WriteToHandle_(bool active, HandleGuard<ReaderConfig>& guard) override
51 {
52 CVB_CALL_CAPI(CvcBcSetEAN8(reinterpret_cast<std::intptr_t>(guard.Handle()),
53 SmartBool(active),
54 checkQuietzone_,
55 appendix2Present_,
56 appendix5Present_,
57 inverse_
58 ));
59 }
60 protected:
61 Ean8()
62 : ReaderEanUpcConfigBase()
63 {
64 }
65
66 };
67
68 using Ean8Ptr = std::shared_ptr<Ean8>;
69 }
70
71 CVB_END_INLINE_NS
72}
Configuration to access parameters of ReaderEanUpcConfigBase.
Definition: reader_ean_upc_config_base.hpp:20
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
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:97
@ Ean8
EAN 8 Barcode.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24