71 explicit Roi(std::shared_ptr<peak::afl::Controller> controller)
72 : m_controller{ std::move(controller) }
96 if (value.GetX() < 0 || value.GetY() < 0)
102 m_controller->SetROI(
103 {
static_cast<uint32_t
>(value.GetX()),
static_cast<uint32_t
>(value.GetY()), value.GetWidth(), value.GetHeight() });
124 const auto result = m_controller->GetROI();
125 return {
static_cast<int32_t
>(result.x),
static_cast<int32_t
>(result.y), result.width, result.height };
147 const auto roi =
Get();
148 subArchive->SetInt(
"X", roi.GetX());
149 subArchive->SetInt(
"Y", roi.GetY());
150 subArchive->SetInt(
"Width", roi.GetWidth());
151 subArchive->SetInt(
"Height", roi.GetHeight());
174 const auto subArchive = archive.
GetArchive(
"Roi");
176 const auto x =
static_cast<int32_t
>(subArchive->GetInt(
"X"));
177 const auto y =
static_cast<int32_t
>(subArchive->GetInt(
"Y"));
178 const auto width =
static_cast<uint32_t
>(subArchive->GetInt(
"Width"));
179 const auto height =
static_cast<uint32_t
>(subArchive->GetInt(
"Height"));
181 Set({ x, y, width, height });
192 std::shared_ptr<peak::afl::Controller> m_controller;
The exception thrown for passing an invalid parameter to a function.
Definition peak_afl.hpp:436
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:54
virtual std::shared_ptr< IArchive > GetArchive(const std::string &key) const =0
Retrieves a nested archive by key.
virtual std::shared_ptr< IArchive > CreateArchive() const =0
Creates a new, empty archive instance.
virtual void SetArchive(const std::string &key, const std::shared_ptr< IArchive > &value)=0
Stores a nested archive object.
Base interface for auto feature implementations.
Definition peak_afl_ifeature.hpp:55
peak::common::Rectangle Get() const override
Gets the current region of interest rectangle.
Definition peak_afl_roi.hpp:122
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current ROI to an archive.
Definition peak_afl_roi.hpp:143
Roi(std::shared_ptr< peak::afl::Controller > controller)
Constructs a Roi feature with the specified controller.
Definition peak_afl_roi.hpp:71
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes the ROI from an archive.
Definition peak_afl_roi.hpp:172
void Set(const peak::common::Rectangle &value) override
Sets the region of interest rectangle.
Definition peak_afl_roi.hpp:94
@ PEAK_AFL_STATUS_INVALID_PARAMETER
Invalid parameter provided.
Definition peak_afl.h:416
detail::RectangleT< int32_t, uint32_t > Rectangle
Rectangle with integer coordinates and unsigned dimensions.
Definition peak_common_rectangle.hpp:231
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