IDS peak AFL v1.8.0
Loading...
Searching...
No Matches
peak_afl_skip_frames.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
57class SkipFrames : public IRangeFeature<uint32_t>
58{
59public:
72 explicit SkipFrames(std::shared_ptr<peak::afl::Controller> controller)
73 : m_controller{ std::move(controller) }
74 {}
75
97 void Set(const uint32_t& value) override
98 {
99 m_controller->SetSkipFrames(value);
100 }
101
118 PEAK_COMMON_NO_DISCARD uint32_t Get() const override
119 {
120 return m_controller->GetSkipFrames();
121 }
122
144 {
145 const auto result = m_controller->GetSkipFramesRange();
146 return { result.min, result.max, result.inc };
147 }
148
164 {
165 archive.SetInt("SkipFrames", Get());
166 }
167
184 {
185 Set(static_cast<uint32_t>(archive.GetInt("SkipFrames")));
186 }
187
188private:
196 std::shared_ptr<peak::afl::Controller> m_controller;
197};
198
199} // namespace features
200} // namespace autofeature
201} // namespace modules
202} // namespace pipeline
203} // 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 PEAK_COMMON_NO_DISCARD 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:128
void Set(const uint32_t &value) override
Sets the number of frames to skip.
Definition peak_afl_skip_frames.hpp:97
PEAK_COMMON_NO_DISCARD uint32_t Get() const override
Gets the current number of frames to skip.
Definition peak_afl_skip_frames.hpp:118
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current skip frames value to an archive.
Definition peak_afl_skip_frames.hpp:163
PEAK_COMMON_NO_DISCARD peak::common::RangeU GetRange() const override
Gets the valid range for skip frames values.
Definition peak_afl_skip_frames.hpp:143
SkipFrames(std::shared_ptr< peak::afl::Controller > controller)
Constructs a SkipFrames feature with the specified controller.
Definition peak_afl_skip_frames.hpp:72
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the skip frames value from an archive.
Definition peak_afl_skip_frames.hpp:183
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.hpp:91
detail::RangeT< uint32_t > RangeU
Alias for a range of 32-bit unsigned integers.
Definition peak_common_range.hpp:132
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