Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
QRReader.h
1#pragma once
2
3#include "Module.h"
4#include "ZXing/ReadBarcode.h"
5#include "ZXing/TextUtfEncoding.h"
6#include <array>
7#include <map>
8#include <vector>
9#include "declarative/PropertyMacros.h"
10
12{
13public:
15
16 // ============================================================
17 // Property Binding for Declarative Pipeline
18 // QRReader has no configurable properties
19 // ============================================================
20 template<typename PropsT>
21 static void applyProperties(
22 PropsT& props,
23 const std::map<std::string, apra::ScalarPropertyValue>& values,
24 std::vector<std::string>& missingRequired
25 ) {
26 // No properties to apply
27 }
28
29 apra::ScalarPropertyValue getProperty(const std::string& propName) const {
30 throw std::runtime_error("Unknown property: " + propName);
31 }
32
33 bool setProperty(const std::string& propName, const apra::ScalarPropertyValue& value) {
34 throw std::runtime_error("Unknown property: " + propName);
35 }
36
37 static std::vector<std::string> dynamicPropertyNames() {
38 return {};
39 }
40};
41
42class QRReader : public Module
43{
44
45public:
47 virtual ~QRReader();
48 bool init();
49 bool term();
50
51protected:
52 bool process(frame_container& frames);
53 bool processSOS(frame_sp& frame);
54 bool validateInputPins();
55 bool validateOutputPins();
56 bool shouldTriggerSOS();
57
58private:
59 class Detail;
60 boost::shared_ptr<Detail> mDetail;
61};
Definition Module.h:33
Definition Module.h:151
Definition QRReader.h:12
apra::ScalarPropertyValue getProperty(const std::string &propName) const
Definition QRReader.h:29
QRReaderProps()
Definition QRReader.h:14
static void applyProperties(PropsT &props, const std::map< std::string, apra::ScalarPropertyValue > &values, std::vector< std::string > &missingRequired)
Definition QRReader.h:21
bool setProperty(const std::string &propName, const apra::ScalarPropertyValue &value)
Definition QRReader.h:33
static std::vector< std::string > dynamicPropertyNames()
Definition QRReader.h:37
Definition QRReader.cpp:9
Definition QRReader.h:43
bool validateInputPins()
Definition QRReader.cpp:69
boost::shared_ptr< Detail > mDetail
Definition QRReader.h:60
bool init()
Definition QRReader.cpp:107
virtual ~QRReader()
Definition QRReader.cpp:67
bool term()
Definition QRReader.cpp:117
bool process(frame_container &frames)
Definition QRReader.cpp:122
QRReader(QRReaderProps _props=QRReaderProps())
Definition QRReader.cpp:60
bool shouldTriggerSOS()
Definition QRReader.cpp:146
bool validateOutputPins()
Definition QRReader.cpp:88
bool processSOS(frame_sp &frame)
Definition QRReader.cpp:139
std::variant< int64_t, double, bool, std::string > ScalarPropertyValue
Definition ModuleRegistry.h:30