Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
RotateCV.h
1
2#pragma once
3
4#include "Module.h"
5#include "declarative/PropertyMacros.h"
6
8{
9public:
10 RotateCVProps(double _angle)
11 {
12 angle = _angle;
13 }
14
15 RotateCVProps() : angle(0.0) {}
16
17 double angle;
18
19 // ============================================================
20 // Property Binding for Declarative Pipeline
21 // ============================================================
22 template<typename PropsT>
23 static void applyProperties(
24 PropsT& props,
25 const std::map<std::string, apra::ScalarPropertyValue>& values,
26 std::vector<std::string>& missingRequired
27 ) {
28 apra::applyProp(props.angle, "angle", values, true, missingRequired);
29 }
30
31 apra::ScalarPropertyValue getProperty(const std::string& propName) const {
32 if (propName == "angle") return angle;
33 throw std::runtime_error("Unknown property: " + propName);
34 }
35
36 bool setProperty(const std::string& propName, const apra::ScalarPropertyValue& value) {
37 throw std::runtime_error("Cannot modify static property '" + propName + "' after initialization");
38 }
39
40 static std::vector<std::string> dynamicPropertyNames() {
41 return {};
42 }
43};
44
45class RotateCV : public Module
46{
47
48public:
50 virtual ~RotateCV();
51 bool init();
52 bool term();
53
54protected:
55 bool process(frame_container &frames);
56 bool processSOS(frame_sp &frame);
57 bool validateInputPins();
58 bool validateOutputPins();
59 void addInputPin(framemetadata_sp &metadata, string &pinId); // throws exception if validation fails
60 bool shouldTriggerSOS();
61 bool processEOS(string &pinId);
62
63private:
64 class Detail;
65 boost::shared_ptr<Detail> mDetail;
66};
Definition Module.h:33
Definition Module.h:151
Definition RotateCV.h:8
double angle
Definition RotateCV.h:17
static std::vector< std::string > dynamicPropertyNames()
Definition RotateCV.h:40
RotateCVProps()
Definition RotateCV.h:15
bool setProperty(const std::string &propName, const apra::ScalarPropertyValue &value)
Definition RotateCV.h:36
static void applyProperties(PropsT &props, const std::map< std::string, apra::ScalarPropertyValue > &values, std::vector< std::string > &missingRequired)
Definition RotateCV.h:23
RotateCVProps(double _angle)
Definition RotateCV.h:10
apra::ScalarPropertyValue getProperty(const std::string &propName) const
Definition RotateCV.h:31
Definition RotateCV.cpp:12
Definition RotateCV.h:46
bool validateOutputPins()
Definition RotateCV.cpp:116
bool processSOS(frame_sp &frame)
Definition RotateCV.cpp:181
virtual ~RotateCV()
Definition RotateCV.cpp:88
bool process(frame_container &frames)
Definition RotateCV.cpp:168
bool validateInputPins()
Definition RotateCV.cpp:90
void addInputPin(framemetadata_sp &metadata, string &pinId)
Definition RotateCV.cpp:142
boost::shared_ptr< Detail > mDetail
Definition RotateCV.h:65
bool shouldTriggerSOS()
Definition RotateCV.cpp:188
bool processEOS(string &pinId)
Definition RotateCV.cpp:193
bool term()
Definition RotateCV.cpp:162
bool init()
Definition RotateCV.cpp:152
RotateCV(RotateCVProps props)
Definition RotateCV.cpp:83
void applyProp(T &member, const char *propName, const std::map< std::string, ScalarPropertyValue > &values, bool isRequired, std::vector< std::string > &missingRequired)
Definition PropertyMacros.h:36
std::variant< int64_t, double, bool, std::string > ScalarPropertyValue
Definition ModuleRegistry.h:30