IDS peak AFL v1.8.0
Loading...
Searching...
No Matches
peak_afl_auto_tolerance.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
13#include <peak_afl/peak_afl.hpp>
15
18
19#include <memory>
20
21namespace peak
22{
23namespace pipeline
24{
25namespace modules
26{
27namespace autofeature
28{
29namespace features
30{
31
61class AutoTolerance : public IRangeFeature<uint32_t>
62{
63public:
76 explicit AutoTolerance(std::shared_ptr<peak::afl::Controller> controller)
77 : m_controller{ std::move(controller) }
78 {}
79
102 void Set(const uint32_t& value) override
103 {
104 m_controller->SetAutoTolerance(value);
105 }
106
123 PEAK_COMMON_NO_DISCARD uint32_t Get() const override
124 {
125 return m_controller->GetAutoTolerance();
126 }
127
149 {
150 const auto result = m_controller->GetAutoToleranceRange();
151 return { result.min, result.max, result.inc };
152 }
153
169 {
170 archive.SetInt("AutoTolerance", Get());
171 }
172
189 {
190 Set(static_cast<uint32_t>(archive.GetInt("AutoTolerance")));
191 }
192
193private:
201 std::shared_ptr<peak::afl::Controller> m_controller;
202};
203
204} // namespace features
205} // namespace autofeature
206} // namespace modules
207} // namespace pipeline
208} // 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 PEAK_COMMON_NO_DISCARD 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:76
void Set(const uint32_t &value) override
Sets the auto tolerance value.
Definition peak_afl_auto_tolerance.hpp:102
PEAK_COMMON_NO_DISCARD uint32_t Get() const override
Gets the current auto tolerance value.
Definition peak_afl_auto_tolerance.hpp:123
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current auto tolerance value to an archive.
Definition peak_afl_auto_tolerance.hpp:168
PEAK_COMMON_NO_DISCARD peak::common::RangeU GetRange() const override
Gets the valid range for auto tolerance values.
Definition peak_afl_auto_tolerance.hpp:148
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the auto tolerance value from an archive.
Definition peak_afl_auto_tolerance.hpp:188
Interface for features that have a valid range of values.
Definition peak_afl_ifeature.hpp:128
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.hpp:91
detail::RangeT< uint32_t > RangeU
Alias for a range of 32-bit unsigned integers.
Definition peak_common_range.hpp:132
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