CVB++ 15.0
Plane Class Reference

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 override
 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_tBasePtr () 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...
 

Detailed Description

Plane information container.

Plane describes a (not necessarily contiguous) data container.

Constructor & Destructor Documentation

◆ Plane()

CVB_BEGIN_INLINE_NS Plane ( const ImagePlane imagePlane,
PlaneRole  role = PlaneRole::Undefined 
)
inlineexplicit

Creates a plane from an image plane.

Parameters
[in]imagePlaneThe image plane.
[in]roleThe role of this plane.
Exceptions
Anyexception 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.

Member Function Documentation

◆ BasePtr()

std::uint8_t * BasePtr ( ) const
inline

Get the pointer to the first element of this plane.

Returns
A pointer to the first element.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ DataType()

class DataType DataType ( ) const
inlineoverridevirtualnoexcept

Gets the data type of the plane.

Datatype identifies a single component's memory layout.

Returns
DataType specifying the components layout.

Implements IArray.

◆ FromHandle()

static PlanePtr FromHandle ( HandleGuard< Plane > &&  guard)
inlinestatic

Creates a plane from a classic API handle.

Parameters
[in]guardLife time guard for C-API handle.

◆ FromImagePlane()

static PlanePtr FromImagePlane ( const ImagePlane imagePlane,
PlaneRole  role = PlaneRole::Undefined 
)
inlinestatic

Creates a plane from an image plane.

Parameters
[in]imagePlaneThe image plane.
[in]roleThe role of this plane.
Returns
A pointer to the new plane.
Exceptions
Anyexception 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.

Examples
Cvb/CppPointCloudAcquisition.

◆ Handle()

void * Handle ( ) const
inlineoverridevirtualnoexcept

Classic API image handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

Implements IArray.

◆ Increment()

std::intptr_t Increment ( int  dimension) const
inline

Gets the offset in bytes to move to the next element in the given dimension.

Parameters
[in]dimensionDimension to access the increment for.
Returns
The increment in bytes.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Length()

int Length ( int  dimension) const
inline

Gets the number of elements in the given dimension.

Parameters
[in]dimensionDimension to access the length for.
Returns
int Number of elements.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Rank()

int Rank ( ) const
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.

Returns
Number of dimensions in this plane.

Implements IArray.

◆ Role()

PlaneRole Role ( ) const
inlinenoexcept

Get the meaning of this plane.

Returns
The meaning of this plane.
Exceptions
Doesnot throw any exception.