IDS peak AFL v2.0.1
Loading...
Searching...
No Matches
peak_afl_focus_limit.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{
62class FocusLimit : public IFeature<peak::common::Interval>
63{
64public:
77 explicit FocusLimit(std::shared_ptr<peak::afl::Controller> controller)
78 : m_controller{ std::move(controller) }
79 {}
80
100 void Set(const peak::common::Interval& value) override
101 {
102 m_controller->SetLimit({ value.GetMinimum(), value.GetMaximum() });
103 }
104
122 {
123 const auto result = m_controller->GetLimit();
124 return { result.min, result.max };
125 }
126
142 {
143 const auto interval = Get();
144 archive.SetInt("Min", interval.GetMinimum());
145 archive.SetInt("Max", interval.GetMaximum());
146 }
147
164 {
165 Set({ static_cast<int32_t>(archive.GetInt("Min")), static_cast<int32_t>(archive.GetInt("Max")) });
166 }
167
168private:
176 std::shared_ptr<peak::afl::Controller> m_controller{};
177};
178} // namespace features
179} // namespace autofeature
180} // namespace modules
181} // namespace pipeline
182} // 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 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:121
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current focus limits to an archive.
Definition peak_afl_focus_limit.hpp:141
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the focus limits from an archive.
Definition peak_afl_focus_limit.hpp:163
void Set(const peak::common::Interval &value) override
Sets the focus position limits.
Definition peak_afl_focus_limit.hpp:100
FocusLimit(std::shared_ptr< peak::afl::Controller > controller)
Constructs a FocusLimit feature with the specified controller.
Definition peak_afl_focus_limit.hpp:77
Base interface for auto feature implementations.
Definition peak_afl_ifeature.hpp:59
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.h:86
detail::IntervalT< int32_t > Interval
Interval with signed 32-bit integer boundaries.
Definition peak_common_interval.hpp:230
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