IDS peak AFL v2.1.0
Loading...
Searching...
No Matches
peak_afl_auto_percentile.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{
53class AutoPercentile : public IRangeFeature<double>
54{
55public:
68 explicit AutoPercentile(std::shared_ptr<peak::afl::Controller> controller)
69 : m_controller{ std::move(controller) }
70 {}
71
91 void Set(const double& value) override
92 {
93 m_controller->SetAutoPercentile(value);
94 }
95
112 PEAK_COMMON_NO_DISCARD double Get() const override
113 {
114 return m_controller->GetAutoPercentile();
115 }
116
137 PEAK_COMMON_NO_DISCARD RangeD GetRange() const override
138 {
139 const auto result = m_controller->GetAutoPercentileRange();
140 return { result.min, result.max, result.inc };
141 }
142
158 {
159 archive.SetDouble("AutoPercentile", Get());
160 }
161
178 {
179 Set(archive.GetDouble("AutoPercentile"));
180 }
181
182private:
190 std::shared_ptr<peak::afl::Controller> m_controller;
191};
192} // namespace features
193} // namespace autofeature
194} // namespace modules
195} // namespace pipeline
196} // namespace peak
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:54
virtual double GetDouble(const std::string &key) const =0
Retrieves a double-precision number by key.
virtual void SetDouble(const std::string &key, double value)=0
Stores a double-precision floating point number.
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current auto percentile value to an archive.
Definition peak_afl_auto_percentile.hpp:157
AutoPercentile(std::shared_ptr< peak::afl::Controller > controller)
Constructs an AutoPercentile feature with the specified controller.
Definition peak_afl_auto_percentile.hpp:68
double Get() const override
Gets the current auto percentile value.
Definition peak_afl_auto_percentile.hpp:112
void Set(const double &value) override
Sets the auto percentile value.
Definition peak_afl_auto_percentile.hpp:91
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the auto percentile value from an archive.
Definition peak_afl_auto_percentile.hpp:177
RangeD GetRange() const override
Gets the valid range for auto percentile values.
Definition peak_afl_auto_percentile.hpp:137
Interface for features that have a valid range of values.
Definition peak_afl_ifeature.hpp:122
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
peak::common::detail::RangeT< double > RangeD
Type alias for double-precision range values.
Definition peak_afl_ifeature.hpp:22