IDS peak AFL v2.1.0
Loading...
Searching...
No Matches
peak_afl_focus_limit.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{
58class FocusLimit : public IFeature<peak::common::Interval>
59{
60public:
73 explicit FocusLimit(std::shared_ptr<peak::afl::Controller> controller)
74 : m_controller{ std::move(controller) }
75 {}
76
96 void Set(const peak::common::Interval& value) override
97 {
98 m_controller->SetLimit({ value.GetMinimum(), value.GetMaximum() });
99 }
100
117 PEAK_COMMON_NO_DISCARD peak::common::Interval Get() const override
118 {
119 const auto result = m_controller->GetLimit();
120 return { result.min, result.max };
121 }
122
138 {
139 const auto interval = Get();
140 archive.SetInt("Min", interval.GetMinimum());
141 archive.SetInt("Max", interval.GetMaximum());
142 }
143
160 {
161 Set({ static_cast<int32_t>(archive.GetInt("Min")), static_cast<int32_t>(archive.GetInt("Max")) });
162 }
163
164private:
172 std::shared_ptr<peak::afl::Controller> m_controller{};
173};
174} // namespace features
175} // namespace autofeature
176} // namespace modules
177} // namespace pipeline
178} // 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.
peak::common::Interval Get() const override
Gets the current focus position limits.
Definition peak_afl_focus_limit.hpp:117
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current focus limits to an archive.
Definition peak_afl_focus_limit.hpp:137
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the focus limits from an archive.
Definition peak_afl_focus_limit.hpp:159
void Set(const peak::common::Interval &value) override
Sets the focus position limits.
Definition peak_afl_focus_limit.hpp:96
FocusLimit(std::shared_ptr< peak::afl::Controller > controller)
Constructs a FocusLimit feature with the specified controller.
Definition peak_afl_focus_limit.hpp:73
Base interface for auto feature implementations.
Definition peak_afl_ifeature.hpp:55
detail::IntervalT< int32_t > Interval
Interval with signed 32-bit integer boundaries.
Definition peak_common_interval.hpp:242
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