6#include "../_cexports/c_img.h"
8#include "../global.hpp"
9#include "../point_2d.hpp"
12#include "decl_access_base.hpp"
48 assert(origin.
X() >= 0 && origin.
Y() >= 0);
49 assert(base !=
nullptr && vpat !=
nullptr
71 Vpat(std::uint8_t *base,
Entry *vpat,
int width)
72 : Vpat(base, vpat, {}, width)
71 Vpat(std::uint8_t *base,
Entry *vpat,
int width) {
…}
76 Vpat(
const Vpat &other)
noexcept =
default;
77 Vpat &operator=(
const Vpat &other)
noexcept =
default;
78 Vpat(
Vpat &&other)
noexcept =
default;
79 Vpat &operator=(
Vpat &&other)
noexcept =
default;
92 return Vpat{basePtr_, vpatPtr_, origin_ +
Cvb::Point2D<int>{newAoi.Left(), newAoi.Top()}, newAoi.Width()};
139 CVB_FORCE_INLINE
int Width() const noexcept
139 CVB_FORCE_INLINE
int Width() const noexcept {
…}
152 return this->basePtr_ !=
nullptr && this->vpatPtr_ !=
nullptr && origin_.X() >= 0 && origin_.Y() >= 0
157 explicit operator bool() const noexcept
159 return this->
Valid();
157 explicit operator bool() const noexcept {
…}
172 CVB_FORCE_INLINE
const void *
operator()(
int x,
int y)
const noexcept
174 return reinterpret_cast<const void *
>(this->basePtr_ + vpatPtr_[origin_.Y() + y].OffsetY
175 + vpatPtr_[origin_.X() + x].OffsetX);
172 CVB_FORCE_INLINE
const void *
operator()(
int x,
int y)
const noexcept {
…}
190 return reinterpret_cast<void *
>(this->basePtr_ + vpatPtr_[origin_.Y() + y].OffsetY
191 + vpatPtr_[origin_.X() + x].OffsetX);
203 CVB_FORCE_INLINE
const void *
operator[](
int idx)
const noexcept
205 const int y = idx / this->width_;
206 const int x = idx % this->width_;
208 return reinterpret_cast<const void *
>(this->basePtr_ + vpatPtr_[origin_.Y() + y].OffsetY
209 + vpatPtr_[origin_.X() + x].OffsetX);
203 CVB_FORCE_INLINE
const void *
operator[](
int idx)
const noexcept {
…}
223 const int y = idx / this->width_;
224 const int x = idx % this->width_;
226 return reinterpret_cast<void *
>(this->basePtr_ + vpatPtr_[origin_.Y() + y].OffsetY
227 + vpatPtr_[origin_.X() + x].OffsetX);
248 : rowbasePtr_(rowBase)
261 Row(
const Row &other)
noexcept =
default;
262 Row &operator=(
const Row &other)
noexcept =
default;
263 Row(
Row &&other)
noexcept =
default;
264 Row &operator=(
Row &&other)
noexcept =
default;
278 return reinterpret_cast<void *
>(rowbasePtr_ + vpatPtr_[x].OffsetX);
290 CVB_FORCE_INLINE
const void *
operator[](
int x)
const noexcept
292 return reinterpret_cast<const void *
>(rowbasePtr_ + vpatPtr_[x].OffsetX);
314 : colbasePtr_(colBase)
328 Column &operator=(
const Column &other)
noexcept =
default;
344 return reinterpret_cast<void *
>(colbasePtr_ + vpatPtr_[y].OffsetY);
356 CVB_FORCE_INLINE
const void *
operator[](
int y)
const noexcept
358 return reinterpret_cast<const void *
>(colbasePtr_ + vpatPtr_[y].OffsetY);
373 return {basePtr_ + vpatPtr_[y].OffsetY, vpatPtr_};
387 return {basePtr_ + vpatPtr_[x].OffsetX, vpatPtr_};
393 Entry *vpatPtr_ =
nullptr;
407 inline
bool operator!=(const Vpat &lhs, const Vpat &rhs) noexcept
409 return lhs.BasePtr() != rhs.BasePtr() || lhs.VpatPtr() != rhs.VpatPtr() || lhs.Origin() != rhs.Origin()
410 || lhs.Width() != rhs.Width();
407 inline
bool operator!=(const Vpat &lhs, const Vpat &rhs) noexcept {
…}
421 inline bool operator==(
const Vpat &lhs,
const Vpat &rhs)
noexcept
423 return !(lhs != rhs);
421 inline bool operator==(
const Vpat &lhs,
const Vpat &rhs)
noexcept {
…}
426 using VpatAccess =
Vpat;
The Common Vision Blox image.
Definition decl_image.hpp:50
Image plane information container.
Definition decl_image_plane.hpp:29
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
Rectangle object.
Definition rect.hpp:24
Common base class for access traits, providing typed Value access to planes.
Definition decl_access_base.hpp:23
A single column.
Definition decl_vpat.hpp:301
CVB_FORCE_INLINE const void * operator[](int y) const noexcept
Value access.
Definition decl_vpat.hpp:356
CVB_FORCE_INLINE void * operator[](int y) noexcept
Value access.
Definition decl_vpat.hpp:342
Column() noexcept
Default ctor of invalid column.
Definition decl_vpat.hpp:321
A single row.
Definition decl_vpat.hpp:235
CVB_FORCE_INLINE void * operator[](int x) noexcept
Value access.
Definition decl_vpat.hpp:276
Row() noexcept
Default ctor of invalid row.
Definition decl_vpat.hpp:255
CVB_FORCE_INLINE const void * operator[](int x) const noexcept
Value access.
Definition decl_vpat.hpp:290
Virtual Pixel Access Table.
Definition decl_vpat.hpp:24
CVB_FORCE_INLINE void * operator[](int idx) noexcept
Index pixel access operator.
Definition decl_vpat.hpp:221
bool Valid() const noexcept
Gets whether this vpat access object is valid.
Definition decl_vpat.hpp:150
bool operator==(const Vpat &lhs, const Vpat &rhs) noexcept
Equality operator.
Definition decl_vpat.hpp:421
CVB_FORCE_INLINE int Width() const noexcept
Gets the pixel width of the underlying plane.
Definition decl_vpat.hpp:139
Entry * VpatPtr() const noexcept
Pointer to the native VPAT structure.
Definition decl_vpat.hpp:117
std::uint8_t * BasePtr() const noexcept
VPAT base pointer.
Definition decl_vpat.hpp:104
Vpat NewMoved(const Cvb::Rect< int > newAoi) const noexcept
Creates a new, moved linear access object.
Definition decl_vpat.hpp:90
CVB_FORCE_INLINE const void * operator()(int x, int y) const noexcept
Coordinate pixel access operator.
Definition decl_vpat.hpp:172
Point2D< int > Origin() const noexcept
Gets the origin of the Vpat() for this access trait.
Definition decl_vpat.hpp:129
Row RowAt(int y) const noexcept
Gets the Vpat::Row at y.
Definition decl_vpat.hpp:371
CVB_FORCE_INLINE void * operator()(int x, int y) noexcept
Coordinate pixel access operator.
Definition decl_vpat.hpp:188
Column ColumnAt(int x) const noexcept
Gets the Vpat::Column at x.
Definition decl_vpat.hpp:385
CVB_FORCE_INLINE const void * operator[](int idx) const noexcept
Index pixel access operator.
Definition decl_vpat.hpp:203
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
One entry of the VPAT.
Definition decl_vpat.hpp:33
std::intptr_t OffsetX
X-offset from line start in bytes.
Definition decl_vpat.hpp:35
std::intptr_t OffsetY
Y-offset from line start in bytes.
Definition decl_vpat.hpp:37