3#include "../../global.hpp"
5#include "../_decl/decl_image_rect.hpp"
7#include "../../_decl/decl_device.hpp"
8#include "../../utilities/system_info.hpp"
26 CExports::IMG dummy =
nullptr;
28 auto result = CExports::IRImageSize(parent_->Handle(), CExports::IMAGERECT_CMD_VALIDATE, width, height, dummy);
32 return Size2D<int>(
static_cast<int>(width),
static_cast<int>(height));
37 CExports::cvbdim_t width = 0;
38 CExports::cvbdim_t height = 0;
40 CExports::IMG dummy =
nullptr;
42 auto result = CExports::IRImageSize(parent_->Handle(), CExports::IMAGERECT_CMD_GET, width, height, dummy);
46 return Size2D<int>(
static_cast<int>(width),
static_cast<int>(height));
51 auto width =
static_cast<CExports::cvbdim_t
>(size.
Width());
52 auto height =
static_cast<CExports::cvbdim_t
>(size.
Height());
54 CExports::IMG dummy =
nullptr;
57 CExports::IRImageSize(parent_->Handle(), CExports::IMAGERECT_CMD_VALIDATE, width, height, dummy);
59 std::rethrow_exception(CvbException::FromCvbResult(validateResult,
"failed validate image rectangle size"));
61 CExports::IMG handle =
nullptr;
62 auto setResult = CExports::IRImageSize(parent_->Handle(), CExports::IMAGERECT_CMD_SET, width, height, handle);
66 HandleGuard<Device> guard(handle);
72 CExports::cvbdim_t width = 0;
73 CExports::cvbdim_t height = 0;
75 auto result = CExports::IRImageOffset(parent_->Handle(), CExports::IMAGERECT_CMD_GET, width, height);
79 return Point2D<int>(
static_cast<int>(width),
static_cast<int>(height));
84 auto width =
static_cast<CExports::cvbdim_t
>(point.
X());
85 auto height =
static_cast<CExports::cvbdim_t
>(point.
Y());
87 auto validateResult = CExports::IRImageOffset(parent_->Handle(), CExports::IMAGERECT_CMD_VALIDATE, width, height);
88 if (validateResult < 0)
91 auto setResult = CExports::IRImageOffset(parent_->Handle(), CExports::IMAGERECT_CMD_SET, width, height);
98 CExports::cvbdim_t dummy = 0;
100 CExports::IMG handle =
nullptr;
102 auto setResult = CExports::IRImageSize(parent_->Handle(), CExports::IMAGERECT_CMD_RESET, dummy, dummy, handle);
106 HandleGuard<Device> guard(handle);
Size2D< int > Size() const
Gets the current rectangle size.
Definition detail_image_rect.hpp:35
Size2D< int > SensorSize() const
Gets the sensor size.
Definition detail_image_rect.hpp:18
void SetOffset(Point2D< int > point)
Sets the offset of the image rectangle.
Definition detail_image_rect.hpp:82
Point2D< int > Offset() const
Gets the offset of the image rectangle.
Definition detail_image_rect.hpp:70
void ApplySize(Size2D< int > size, DeviceUpdateMode mode)
Sets the size.
Definition detail_image_rect.hpp:49
DevicePtr Parent() const noexcept
Gets the parent device of this interface.
Definition decl_image_rect.hpp:31
void Update(DeviceUpdateMode mode)
Updates the CVB buffer according to the current device settings.
Definition detail_image_rect.hpp:96
Multi-purpose 2D vector class.
Definition point_2d.hpp:20
T X() const noexcept
Gets the x-component of the point.
Definition point_2d.hpp:84
T Y() const noexcept
Gets the y-component of the point.
Definition point_2d.hpp:104
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition size_2d.hpp:20
T Height() const noexcept
Gets the vertical component of the size.
Definition size_2d.hpp:77
T Width() const noexcept
Gets the horizontal component of the size.
Definition size_2d.hpp:57
Namespace for driver or device related operations.
Definition decl_composite.hpp:28
const int CVB_NOTSUPPORTED
A certain feature is not supported.
Definition exception.hpp:59
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
DeviceUpdateMode
Defines how to treat the optional device image, when the device itself is updated.
Definition global.hpp:252
T rethrow_exception(T... args)