ean13.hpp
1 #pragma once
2 
3 #include "reader_ean_upc_config_base.hpp"
4 
5 namespace 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::Ean13; }
21 
23 
29  static std::unique_ptr<Ean13> FromHandle(const HandleGuard<ReaderConfig>& guard, bool& isActiveOut)
30  {
31  auto pConfig = std::unique_ptr<Ean13>(new Ean13());
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(CvcBcGetEAN13(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(CvcBcSetEAN13(reinterpret_cast<std::intptr_t>(guard.Handle()),
53  SmartBool(active),
54  checkQuietzone_,
55  appendix2Present_,
56  appendix5Present_,
57  inverse_
58  ));
59  }
60  protected:
61  Ean13()
62  : ReaderEanUpcConfigBase()
63  {
64  }
65 
66  };
67 
68  using Ean13Ptr = std::shared_ptr<Ean13>;
69  }
70 
71  CVB_END_INLINE_NS
72 }
STL class.
Symbology
The symbologies supported by Barcode.
Definition: barcode.hpp:96
Root namespace for the Image Manager interface.
Definition: version.hpp:11
Configuration to access parameters of Ean13.
Definition: ean13.hpp:16
STL class.
Configuration to access parameters of ReaderEanUpcConfigBase.
Definition: reader_ean_upc_config_base.hpp:19
virtual Symbology Type() const override
Symbology of configuration object.
Definition: ean13.hpp:20
static std::unique_ptr< Ean13 > FromHandle(const HandleGuard< ReaderConfig > &guard, bool &isActiveOut)
Create object from handle.
Definition: ean13.hpp:29