IDS peak AFL v2.1.0
Loading...
Searching...
No Matches
peak_afl_hysteresis.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
11
13
14#include <memory>
15
16namespace peak
17{
18namespace pipeline
19{
20namespace modules
21{
22namespace autofeature
23{
24namespace features
25{
55class Hysteresis : public IRangeFeature<uint8_t>
56{
57public:
70 explicit Hysteresis(std::shared_ptr<peak::afl::Controller> controller)
71 : m_controller{ std::move(controller) }
72 {}
73
94 void Set(const uint8_t& value) override
95 {
96 m_controller->SetHysteresis(value);
97 }
98
115 PEAK_COMMON_NO_DISCARD uint8_t Get() const override
116 {
117 return m_controller->GetHysteresis();
118 }
119
140 PEAK_COMMON_NO_DISCARD peak::common::RangeU8 GetRange() const override
141 {
142 const auto result = m_controller->GetHysteresisRange();
143 return { result.min, result.max, result.inc };
144 }
145
161 {
162 archive.SetInt("Hysteresis", Get());
163 }
164
181 {
182 Set(static_cast<uint8_t>(archive.GetInt("Hysteresis")));
183 }
184
185private:
193 std::shared_ptr<peak::afl::Controller> m_controller;
194};
195} // namespace features
196} // namespace autofeature
197} // namespace modules
198} // namespace pipeline
199} // namespace peak
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:54
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:115
peak::common::RangeU8 GetRange() const override
Gets the valid range for hysteresis values.
Definition peak_afl_hysteresis.hpp:140
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current hysteresis value to an archive.
Definition peak_afl_hysteresis.hpp:160
void Set(const uint8_t &value) override
Sets the hysteresis value.
Definition peak_afl_hysteresis.hpp:94
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the hysteresis value from an archive.
Definition peak_afl_hysteresis.hpp:180
Hysteresis(std::shared_ptr< peak::afl::Controller > controller)
Constructs a Hysteresis feature with the specified controller.
Definition peak_afl_hysteresis.hpp:70
Interface for features that have a valid range of values.
Definition peak_afl_ifeature.hpp:122
detail::RangeT< uint8_t > RangeU8
Alias for a range of 8-bit unsigned integers.
Definition peak_common_range.hpp:297
Interface definitions and implementations for individual module types used within a pipeline.
Definition peak_afl_generic_auto_brightness.hpp:35
Interfaces and implementations for defining and controlling data processing pipelines.
Definition peak_afl_generic_auto_brightness.hpp:33