CVB++ 15.0
PFNCBuffer Class Reference

PFNC buffer class implementing a pfnc buffer. More...

#include <cvb/pfnc_buffer.hpp>

Inherits BufferBase.

Public Member Functions

int PFNCValue () const noexcept
 Gets the PFNC value (format identifier) of this buffer. More...
 
int Rank () const noexcept
 Gets the number of dimensions of this buffer. More...
 
int Length (int dimension) const
 Gets the number of elements in the given Dimension. More...
 
std::intptr_t Increment (int dimension) const
 Gets the increment to the next element in the given Dimension. More...
 
- Public Member Functions inherited from BufferBase
void * Handle () const noexcept
 Classic API buffer handle. More...
 
std::uint8_tBasePtr () const noexcept
 Gets the pointer to the start of this buffer. More...
 
size_t Size () const noexcept
 Gets the actual size of this buffer in bytes. More...
 
size_t Capacity () const noexcept
 Gets the allocated size of this buffer in bytes. More...
 

Static Public Member Functions

static PFNCBufferPtr FromHandle (HandleGuard< BufferBase > &&guard)
 Creates a pfnc buffer from a classic API handle.
 

Detailed Description

PFNC buffer class implementing a pfnc buffer.

Member Function Documentation

◆ Increment()

std::intptr_t Increment ( int  dimension) const
inline

Gets the increment to the next element in the given Dimension.

For a 2d image Dimension 0 would be the x-increment (offset to next pixel) and Dimension 1 would be the y-increment (offset to next line).

The maximal Dimension is GetRank() - 1.

Parameters
[in]dimensionZero-based dimension to access.
Returns
Increment Variable to receive the offset to the next element in the given Dimension 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.

For a 2d image Dimension 0 would be the width and Dimension 1 would be the height.

The maximal Dimension is GetRank() - 1.

Parameters
[in]dimensionZero-based dimension to access.
Returns
Number of elements in the given Dimension.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ PFNCValue()

int PFNCValue ( ) const
inlinenoexcept

Gets the PFNC value (format identifier) of this buffer.

For a listing of the values see GenICam PixelFormatValues: http://www.emva.org/wp-content/uploads/GenICam_PixelFormatValues.pdf (as at time of writing: otherwise look at www.genicam.org > Downloads).

Returns
PFNC value.

◆ Rank()

int Rank ( ) const
inlinenoexcept

Gets the number of dimensions of this buffer.

A normal image has two dimensions (width and height) and thus would return two. A sparse point list (e.g. Coord3D_ABC8 in PFNC) would return a rank of one.

Returns
Number of dimensions in this buffer.