IDS peak AFL v2.1.0
Loading...
Searching...
No Matches
peak_afl_auto_tolerance.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
11
14
15#include <memory>
16
17namespace peak
18{
19namespace pipeline
20{
21namespace modules
22{
23namespace autofeature
24{
25namespace features
26{
56class AutoTolerance : public IRangeFeature<uint32_t>
57{
58public:
71 explicit AutoTolerance(std::shared_ptr<peak::afl::Controller> controller)
72 : m_controller{ std::move(controller) }
73 {}
74
97 void Set(const uint32_t& value) override
98 {
99 m_controller->SetAutoTolerance(value);
100 }
101
118 PEAK_COMMON_NO_DISCARD uint32_t Get() const override
119 {
120 return m_controller->GetAutoTolerance();
121 }
122
143 PEAK_COMMON_NO_DISCARD peak::common::RangeU GetRange() const override
144 {
145 const auto result = m_controller->GetAutoToleranceRange();
146 return { result.min, result.max, result.inc };
147 }
148
164 {
165 archive.SetInt("AutoTolerance", Get());
166 }
167
184 {
185 Set(static_cast<uint32_t>(archive.GetInt("AutoTolerance")));
186 }
187
188private:
196 std::shared_ptr<peak::afl::Controller> m_controller;
197};
198} // namespace features
199} // namespace autofeature
200} // namespace modules
201} // namespace pipeline
202} // 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.
AutoTolerance(std::shared_ptr< peak::afl::Controller > controller)
Constructs an AutoTolerance feature with the specified controller.
Definition peak_afl_auto_tolerance.hpp:71
void Set(const uint32_t &value) override
Sets the auto tolerance value.
Definition peak_afl_auto_tolerance.hpp:97
uint32_t Get() const override
Gets the current auto tolerance value.
Definition peak_afl_auto_tolerance.hpp:118
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current auto tolerance value to an archive.
Definition peak_afl_auto_tolerance.hpp:163
peak::common::RangeU GetRange() const override
Gets the valid range for auto tolerance values.
Definition peak_afl_auto_tolerance.hpp:143
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the auto tolerance value from an archive.
Definition peak_afl_auto_tolerance.hpp:183
Interface for features that have a valid range of values.
Definition peak_afl_ifeature.hpp:122
detail::RangeT< uint32_t > RangeU
Alias for a range of 32-bit unsigned integers.
Definition peak_common_range.hpp:222
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