IDS peak AFL v1.8.0
Loading...
Searching...
No Matches
peak_afl_auto_percentile.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{
30
58class AutoPercentile : public IRangeFeature<double>
59{
60public:
73 explicit AutoPercentile(std::shared_ptr<peak::afl::Controller> controller)
74 : m_controller{ std::move(controller) }
75 {}
76
96 void Set(const double& value) override
97 {
98 m_controller->SetAutoPercentile(value);
99 }
100
117 PEAK_COMMON_NO_DISCARD double Get() const override
118 {
119 return m_controller->GetAutoPercentile();
120 }
121
143 {
144 const auto result = m_controller->GetAutoPercentileRange();
145 return { result.min, result.max, result.inc };
146 }
147
163 {
164 archive.SetDouble("AutoPercentile", Get());
165 }
166
183 {
184 Set(archive.GetDouble("AutoPercentile"));
185 }
186
187private:
195 std::shared_ptr<peak::afl::Controller> m_controller;
196};
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:59
virtual PEAK_COMMON_NO_DISCARD 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.
PEAK_COMMON_NO_DISCARD double Get() const override
Gets the current auto percentile value.
Definition peak_afl_auto_percentile.hpp:117
PEAK_COMMON_NO_DISCARD RangeD GetRange() const override
Gets the valid range for auto percentile values.
Definition peak_afl_auto_percentile.hpp:142
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current auto percentile value to an archive.
Definition peak_afl_auto_percentile.hpp:162
AutoPercentile(std::shared_ptr< peak::afl::Controller > controller)
Constructs an AutoPercentile feature with the specified controller.
Definition peak_afl_auto_percentile.hpp:73
void Set(const double &value) override
Sets the auto percentile value.
Definition peak_afl_auto_percentile.hpp:96
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the auto percentile value from an archive.
Definition peak_afl_auto_percentile.hpp:182
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
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
peak::common::detail::RangeT< double > RangeD
Type alias for double-precision range values.
Definition peak_afl_ifeature.hpp:27