Plane information container. More...
#include <cvb/plane.hpp>
Inherits IArray.
Public Member Functions | |
Plane (const ImagePlane &imagePlane, PlaneRole role=PlaneRole::Undefined) | |
Creates a plane from an image plane. More... | |
void * | Handle () const noexcept |
Classic API image handle. More... | |
int | Rank () const noexcept override |
Gets the number of dimensions of this plane. More... | |
PlaneRole | Role () const noexcept |
Get the meaning of this plane. More... | |
class DataType | DataType () const noexcept override |
Gets the data type of the plane. More... | |
std::intptr_t | Increment (int dimension) const |
Gets the offset in bytes to move to the next element in the given dimension. More... | |
int | Length (int dimension) const |
Gets the number of elements in the given dimension. More... | |
std::uint8_t * | BasePtr () const |
Get the pointer to the first element of this plane. More... | |
virtual void * | Handle () const noexcept=0 |
Classic API image handle. More... | |
virtual class DataType | DataType () const noexcept=0 |
Data type descriptor for this array. More... | |
virtual int | Rank () const noexcept=0 |
Gets the number of dimensions for this array. More... | |
Static Public Member Functions | |
static PlanePtr | FromImagePlane (const ImagePlane &imagePlane, PlaneRole role=PlaneRole::Undefined) |
Creates a plane from an image plane. More... | |
static PlanePtr | FromHandle (HandleGuard< Plane > &&guard) |
Creates a plane from a classic API handle. More... | |
Related Functions | |
(Note that these are not member functions.) | |
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. More... | |
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. More... | |
Plane information container.
Plane describes a (not necessarily contiguous) data container.
|
inline |
Creates a plane from an image plane.
[in] | imagePlane | The image plane. |
[in] | role | The role of this plane. |
Any | exception derived from std::exception including CvbException. |
The image plane's image shares its buffer ownership with this plane. The image plane must support linear access.
|
inline |
Get the pointer to the first element of this plane.
Any | exception derived from std::exception including CvbException. |
Creates a plane from a classic API handle.
[in] | guard | Life time guard for C-API handle. |
|
inlinestatic |
Creates a plane from an image plane.
[in] | imagePlane | The image plane. |
[in] | role | The role of this plane. |
Any | exception derived from std::exception including CvbException. |
The image plane's imag shares its buffer ownership with this plane. The image plane must support linear access.
|
inlinevirtualnoexcept |
Classic API image handle.
Does | not throw any exception. |
It is normally not necessary to work with this handle.
Implements IArray.
|
inline |
Gets the offset in bytes to move to the next element in the given dimension.
[in] | dimension | Dimension to access the increment for. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Gets the number of elements in the given dimension.
[in] | dimension | Dimension to access the length for. |
Any | exception derived from std::exception including CvbException. |
|
inlineoverridevirtualnoexcept |
Gets the number of dimensions of this plane.
A normal image has two dimensions (width and height) and thus would return two. A sparse point list (e.g. from a Coord3D_ABC8 PFNC buffer) would return a rank of one.
Implements IArray.
|
inlinenoexcept |
Get the meaning of this plane.
Does | not throw any exception. |
|
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 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. |