IDS peak AFL v2.1.0
Loading...
Searching...
No Matches
peak_afl_skip_frames.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{
52class SkipFrames : public IRangeFeature<uint32_t>
53{
54public:
67 explicit SkipFrames(std::shared_ptr<peak::afl::Controller> controller)
68 : m_controller{ std::move(controller) }
69 {}
70
92 void Set(const uint32_t& value) override
93 {
94 m_controller->SetSkipFrames(value);
95 }
96
113 PEAK_COMMON_NO_DISCARD uint32_t Get() const override
114 {
115 return m_controller->GetSkipFrames();
116 }
117
138 PEAK_COMMON_NO_DISCARD peak::common::RangeU GetRange() const override
139 {
140 const auto result = m_controller->GetSkipFramesRange();
141 return { result.min, result.max, result.inc };
142 }
143
159 {
160 archive.SetInt("SkipFrames", Get());
161 }
162
179 {
180 Set(static_cast<uint32_t>(archive.GetInt("SkipFrames")));
181 }
182
183private:
191 std::shared_ptr<peak::afl::Controller> m_controller;
192};
193} // namespace features
194} // namespace autofeature
195} // namespace modules
196} // namespace pipeline
197} // 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.
Interface for features that have a valid range of values.
Definition peak_afl_ifeature.hpp:122
void Set(const uint32_t &value) override
Sets the number of frames to skip.
Definition peak_afl_skip_frames.hpp:92
uint32_t Get() const override
Gets the current number of frames to skip.
Definition peak_afl_skip_frames.hpp:113
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current skip frames value to an archive.
Definition peak_afl_skip_frames.hpp:158
SkipFrames(std::shared_ptr< peak::afl::Controller > controller)
Constructs a SkipFrames feature with the specified controller.
Definition peak_afl_skip_frames.hpp:67
peak::common::RangeU GetRange() const override
Gets the valid range for skip frames values.
Definition peak_afl_skip_frames.hpp:138
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the skip frames value from an archive.
Definition peak_afl_skip_frames.hpp:178
detail::RangeT< uint32_t > RangeU
Alias for a range of 32-bit unsigned integers.
Definition peak_common_range.hpp:222
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