Non-owning view on a 2d-plane of data. More...
#include <cvb/block.hpp>
Inherits BlockBase< ACCESSTRAIT >.
Classes | |
class | Column |
A single column. More... | |
class | Row |
A single row. More... | |
Public Member Functions | |
Block (ACCESSTRAIT access, Cvb::Size2D< int > size) | |
auto | SubBlock (Cvb::Rect< int > aoi) const -> Block< T, decltype(this->Access().NewMoved(Cvb::Rect< int >{}))> |
Creates a new sub Block from this block. | |
CVB_FORCE_INLINE const PixelType & | operator() (int x, int y) const noexcept |
Coordinate pixel access operator. | |
CVB_FORCE_INLINE PixelType & | operator() (int x, int y) noexcept |
Coordinate pixel access operator. | |
template<class FromPixelType> | |
CVB_FORCE_INLINE auto | Set (int x, int y, const FromPixelType &value) noexcept -> std::enable_if_t<!std::is_convertible< remove_cvref_t< FromPixelType >, remove_cvref_t< PixelType > >::value, void > |
Coordinate setter. | |
CVB_FORCE_INLINE void | Set (int x, int y, const PixelType &value) noexcept |
Coordinate setter. | |
CVB_FORCE_INLINE const PixelType & | operator[] (int idx) const noexcept |
Index pixel access operator. | |
CVB_FORCE_INLINE PixelType & | operator[] (int idx) noexcept |
Coordinate pixel access operator. | |
template<class FromPixelType> | |
CVB_FORCE_INLINE auto | Set (int idx, const FromPixelType &value) noexcept -> std::enable_if_t<!std::is_convertible< remove_cvref_t< FromPixelType >, remove_cvref_t< PixelType > >::value, void > |
Index setter. | |
CVB_FORCE_INLINE void | Set (int idx, const PixelType &value) noexcept |
Index setter. | |
Row | RowAt (int y) const noexcept |
Gets the Block::Row at y. | |
Column | ColumnAt (int x) const noexcept |
Gets the Block::Column at x. | |
![]() | |
CVB_FORCE_INLINE const ACCESSTRAIT & | Access () const noexcept |
Gets the pixel access. | |
CVB_FORCE_INLINE ACCESSTRAIT & | Access () noexcept |
Gets the pixel access. | |
CVB_FORCE_INLINE size_t | Length () const noexcept |
Gets the total number of pixels in this block. | |
CVB_FORCE_INLINE Size2D< int > | Size () const noexcept |
Gets the size of this block. | |
CVB_FORCE_INLINE int | Width () const noexcept |
Gets the width of this block. | |
CVB_FORCE_INLINE int | Height () const noexcept |
Gets the height of this block. | |
bool | Valid () const noexcept |
Gets whether this block is valid. | |
Static Public Attributes | |
static constexpr const bool | IsPixelTypeMutable = true |
! Indicates whether the returned values of operator(x,y) or operator[idx] are mutable. | |
Related Symbols | |
(Note that these are not member symbols.) | |
template<class T> | |
using | ArrayPlaneBlock = Block<T, ArrayAccess> |
A Cvb::Block of a contiguous plane. | |
template<class T> | |
using | LinearPlaneBlock = Block<T, LinearAccess> |
A Cvb::Block of a linear plane. | |
template<class T> | |
using | VpatPlaneBlock = Block<T, VpatAccess> |
A Cvb::Block of a VPAT plane. | |
template<class T, size_t K> | |
using | ScatterBlock = Block<T, ScatterAccess<K>> |
A Cvb::Block of variant planes. | |
template<class VISITOR> | |
auto | Visit (VISITOR &&visitor, const PointCloud &cloud) |
Creates a Cvb::Block based on the cloud object's access trait and pixel type and calls the given visitor with it. | |
template<class T, class VISITOR> | |
auto | VisitAs (VISITOR &&visitor, const PointCloud &cloud) |
Creates a Cvb::Block based on the cloud object's access trait and given pixel type T and calls the given visitor with it. | |
template<class VISITOR, class... PLNS> | |
auto | Visit (VISITOR &&visitor, const Plane &plane, const PLNS &...planes) |
Creates a Cvb::Block based on the plane and planes objects' access traits and pixel type and calls the given visitor with it. | |
template<class T, class VISITOR, class... PLNS> | |
auto | VisitAs (VISITOR &&visitor, const Plane &plane, const PLNS &...planes) |
Creates a Cvb::Block based on the plane and planes objects' access traits and given pixel type T and calls the given visitor with it. | |
template<class VISITOR, class... PLANEARGS> | |
auto | Visit (VISITOR &&visitor, const ImagePlane &plane, const PLANEARGS &...planes) |
Creates Cvb::Block s based on the planes objects' access traits and pixel type, and calls the given visitor with them. | |
template<class PIXEL_TYPE, class VISITOR, class... PLANEARGS> | |
auto | VisitAs (VISITOR &&visitor, const ImagePlane &plane, const PLANEARGS &...planes) |
Creates Cvb::Block s based on the planes objects' access traits and PIXEL_TYPE and calls the given visitor with them. When the PIXEL_TYPE is compile-time known, this overload is useful to avoid unnecessary template instantiations. | |
template<class VISITOR, class PLANE_T, class... PLANEARGS, std::enable_if_t< std::is_same< typename PlaneTraits< PLANE_T >::PlaneT, PLANE_T >::value, int > = 0> | |
auto | Visit (VISITOR &&visitor, const PLANE_T &plane, const PLANEARGS &...planes) |
Creates a Cvb::Block based on the plane and planes objects' access traits and pixel type and calls the given visitor with it. | |
template<class T, class VISITOR, class PLANE_T, class... PLANEARGS, std::enable_if_t< std::is_same< typename PlaneTraits< PLANE_T >::PlaneT, PLANE_T >::value, int > = 0> | |
auto | VisitAs (VISITOR &&visitor, const PLANE_T &plane, const PLANEARGS &...planes) |
Creates Cvb::Block s based on the planes objects' access traits and T and calls the given visitor with them. When the T is compile-time known, this variant is useful to avoid unnecessary template instantiations. | |
Non-owning view on a 2d-plane of data.
T | Plane value type. |
ACCESSTRAIT | Access Trait to access a coordinate. |
|
inlineexplicit |
|
inlinenoexcept |
Gets the Block::Column at x.
[in] | x | Pixel column. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Gets the Block::Row at y.
[in] | y | Pixel row. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Creates a new sub Block from this block.
[in] | aoi | Area of interest of this block. |
std::logic_error | if this not Valid(). |
std::length_error | if aoi is outside bounds. |
|
related |
A Cvb::Block of a contiguous plane.
T | Plane value type. |
|
related |
A Cvb::Block of a linear plane.
T | Plane value type. |
|
related |
A Cvb::Block of variant planes.
T | Plane value type. |
|
related |
Creates Cvb::Block
s based on the planes objects' access traits and pixel type, and calls the given visitor with them.
The planes must have the same pixel type. If all planes support Cvb::ArrayAccess, then all blocks forwarded to the visitor are of type Cvb::ArrayPlaneBlock, if all are of Cvb::LinearAccess, all blocks will be of type Cvb::LinearPlaneBlock, otherwise of type Cvb::VpatPlaneBlock.
VISITOR | Callable that is called with the typed Cvb::Block. |
[in] | visitor | Callable of signature auto(Block<T,ACCESS_TRAIT>, ...) . |
[in] | plane | The first plane to visit. |
[in] | planes | Planes to create typed Cvb::Block s for that will be forwarded to the visitor. |
std::runtime_error | if no pixel type could be matched. |
std::domain_error | if properties of the planes differ. |
|
related |
Creates a Cvb::Block based on the plane and planes objects' access traits and pixel type and calls the given visitor with it.
VISITOR | The visitor functor. |
[in] | visitor | The visiting functor. May either have one argument or exactly as many arguments as planes are given. |
[in] | plane | The first plane to visit. |
[in] | planes | More planes to visit. |
std::domain_error | if properties of the planes differ. |
|
related |
Creates a Cvb::Block based on the plane and planes objects' access traits and pixel type and calls the given visitor with it.
VISITOR | The visitor functor. |
[in] | visitor | The visiting functor. May either have one argument or exactly as many arguments as planes are given. |
[in] | plane | The first plane to visit. |
[in] | planes | More planes to visit. |
std::domain_error | if properties of the planes differ. |
|
related |
Creates a Cvb::Block based on the cloud object's access trait and pixel type and calls the given visitor with it.
VISITOR | Callable that is called with the typed CvbConcepts::Block. |
[in] | visitor | Callable of signature auto(Block<T,ACCESS_TRAIT>). |
[in] | cloud | PointCloud to create typed CvbConcepts::Block for. |
std::runtime_error | if no pixel type could be matched. |
std::domain_error | if properties of the planes differ. |
|
related |
Creates Cvb::Block
s based on the planes objects' access traits and PIXEL_TYPE and calls the given visitor with them. When the PIXEL_TYPE is compile-time known, this overload is useful to avoid unnecessary template instantiations.
The planes must have the same pixel type. If all planes support Cvb::ArrayAccess, then all blocks forwarded to the visitor are of type Cvb::ArrayPlaneBlock, if all are of Cvb::LinearAccess, all blocks will be of type Cvb::LinearPlaneBlock, otherwise of type Cvb::VpatPlaneBlock.
PIXEL_TYPE | The pixel type of the planes. |
VISITOR | Callable that is called with the typed Cvb::Block. |
[in] | visitor | Callable of signature auto(Block<PIXEL_TYPE,ACCESS_TRAIT>, ...) . |
[in] | plane | The first plane to visit. |
[in] | planes | Planes to create typed Cvb::Block s for that will be forwarded to the visitor. |
std::runtime_error | if no pixel type could be matched |
std::domain_error | if properties of the planes differ. |
|
related |
Creates a Cvb::Block based on the plane and planes objects' access traits and given pixel type T and calls the given visitor with it.
VISITOR | The visitor functor. |
[in] | visitor | The visiting functor. May either have one argument or exactly as many arguments as planes are given. |
[in] | plane | The first plane to visit. |
[in] | planes | More planes to visit. |
std::domain_error | if properties of the planes differ. |
|
related |
Creates Cvb::Block
s based on the planes objects' access traits and T and calls the given visitor with them. When the T is compile-time known, this variant is useful to avoid unnecessary template instantiations.
T | The element type of the planes. |
VISITOR | The visitor functor. |
[in] | visitor | The visiting functor. May either have one argument or exactly as many arguments as planes are given. |
[in] | plane | The first plane to visit. |
[in] | planes | More planes to visit. |
std::runtime_error | if no pixel type could be matched |
std::domain_error | if properties of the planes differ. |
|
related |
Creates a Cvb::Block based on the cloud object's access trait and given pixel type T and calls the given visitor with it.
T | Type of the pixel, that can be accessed through the Block. |
VISITOR | Callable that is called with the typed CvbConcepts::Block. |
[in] | visitor | Callable of signature auto(Block<T,ACCESS_TRAIT>). |
[in] | cloud | PointCloud to create typed CvbConcepts::Block for. |
std::runtime_error | if no pixel type could be matched. |
std::domain_error | if properties of the planes differ. |
|
related |
A Cvb::Block of a VPAT plane.
T | Plane value type. |
We use cookies to improve your experience. By using this documentation, you agree to our use of cookies.