IDS peak AFL v2.0.2
Loading...
Searching...
No Matches
peak_afl_hysteresis.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
13#include <peak_afl/peak_afl.hpp>
15
17
18#include <memory>
19
20namespace peak
21{
22namespace pipeline
23{
24namespace modules
25{
26namespace autofeature
27{
28namespace features
29{
59class Hysteresis : public IRangeFeature<uint8_t>
60{
61public:
74 explicit Hysteresis(std::shared_ptr<peak::afl::Controller> controller)
75 : m_controller{ std::move(controller) }
76 {}
77
98 void Set(const uint8_t& value) override
99 {
100 m_controller->SetHysteresis(value);
101 }
102
119 PEAK_COMMON_NO_DISCARD uint8_t Get() const override
120 {
121 return m_controller->GetHysteresis();
122 }
123
144 PEAK_COMMON_NO_DISCARD peak::common::RangeU8 GetRange() const override
145 {
146 const auto result = m_controller->GetHysteresisRange();
147 return { result.min, result.max, result.inc };
148 }
149
165 {
166 archive.SetInt("Hysteresis", Get());
167 }
168
185 {
186 Set(static_cast<uint8_t>(archive.GetInt("Hysteresis")));
187 }
188
189private:
197 std::shared_ptr<peak::afl::Controller> m_controller;
198};
199} // namespace features
200} // namespace autofeature
201} // namespace modules
202} // namespace pipeline
203} // namespace peak
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:59
virtual void SetInt(const std::string &key, int64_t value)=0
Stores a 64-bit signed integer.
virtual int64_t GetInt(const std::string &key) const =0
Retrieves a 64-bit signed integer by key.
uint8_t Get() const override
Gets the current hysteresis value.
Definition peak_afl_hysteresis.hpp:119
peak::common::RangeU8 GetRange() const override
Gets the valid range for hysteresis values.
Definition peak_afl_hysteresis.hpp:144
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current hysteresis value to an archive.
Definition peak_afl_hysteresis.hpp:164
void Set(const uint8_t &value) override
Sets the hysteresis value.
Definition peak_afl_hysteresis.hpp:98
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the hysteresis value from an archive.
Definition peak_afl_hysteresis.hpp:184
Hysteresis(std::shared_ptr< peak::afl::Controller > controller)
Constructs a Hysteresis feature with the specified controller.
Definition peak_afl_hysteresis.hpp:74
Interface for features that have a valid range of values.
Definition peak_afl_ifeature.hpp:126
detail::RangeT< uint8_t > RangeU8
Alias for a range of 8-bit unsigned integers.
Definition peak_common_range.hpp:217
Interface definitions and implementations for individual module types used within a pipeline.
Definition peak_afl_generic_auto_brightness.hpp:39
Interfaces and implementations for defining and controlling data processing pipelines.
Definition peak_afl_generic_auto_brightness.hpp:37