CVB++ 14.1
Vpat Class Referencefinal

Virtual Pixel Access Table. More...

#include <cvb/vpat.hpp>

Inherits ValueAccessBase< Vpat >.

Classes

class  Column
 A single column. More...
 
class  Entry
 One entry of the VPAT. More...
 
class  Row
 A single row. More...
 

Public Member Functions

 Vpat () noexcept
 
 Vpat (std::uint8_t *base, Entry *vpat, int width)
 Construct Vpat from raw values. More...
 
Vpat NewMoved (const Cvb::Rect< int > newAoi) const noexcept
 Creates a new, moved linear access object. More...
 
std::uint8_tBasePtr () const noexcept
 VPAT base pointer. More...
 
EntryVpatPtr () const noexcept
 Pointer to the native VPAT structure. More...
 
Point2D< int > Origin () const noexcept
 Gets the origin of the Vpat() for this access trait. More...
 
CVB_FORCE_INLINE int Width () const noexcept
 Gets the pixel width of the underlying plane. More...
 
bool Valid () const noexcept
 Gets whether this vpat access object is valid. More...
 
 operator bool () const noexcept
 Gets whether this vpat access object is valid. More...
 
CVB_FORCE_INLINE const void * operator() (int x, int y) const noexcept
 Coordinate pixel access operator. More...
 
CVB_FORCE_INLINE void * operator() (int x, int y) noexcept
 Coordinate pixel access operator. More...
 
CVB_FORCE_INLINE const void * operator[] (int idx) const noexcept
 Index pixel access operator. More...
 
CVB_FORCE_INLINE void * operator[] (int idx) noexcept
 Index pixel access operator. More...
 
Row RowAt (int y) const noexcept
 Gets the Vpat::Row at y. More...
 
Column ColumnAt (int x) const noexcept
 Gets the Vpat::Column at x. More...
 
- Public Member Functions inherited from ValueAccessBase< Vpat >
const Type & Value (int x, int y) const noexcept
 Gets a pixel value at a given position. More...
 
Type & Value (int x, int y) noexcept
 Gets a settable pixel value at a given position. More...
 
const Type & Value (Point2D< int > position) const noexcept
 Gets a pixel value at a given position. More...
 
Type & Value (Point2D< int > position) noexcept
 Gets a settable pixel value at a given position. More...
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const Vpat &lhs, const Vpat &rhs) noexcept
 Inequality operator. More...
 
bool operator== (const Vpat &lhs, const Vpat &rhs) noexcept
 Equality operator. More...
 

Detailed Description

Virtual Pixel Access Table.

Constructor & Destructor Documentation

◆ Vpat() [1/2]

Vpat ( )
inlinedefaultnoexcept

Default ctor of invalid vpat access data.

Postcondition
Valid() == false

◆ Vpat() [2/2]

Vpat ( std::uint8_t base,
Entry vpat,
int  width 
)
inline

Construct Vpat from raw values.

Postcondition
Valid() == base != nullptr && vpat != nullptr && width > 0
Parameters
[in]baseBase memory pointer.
[in]vpatVpat pointer.
[in]widthThe width of the plane.

Member Function Documentation

◆ BasePtr()

std::uint8_t * BasePtr ( ) const
inlinenoexcept

VPAT base pointer.

Returns
The base pointer
Exceptions
Doesnot throw any exception.

The base pointer is not necessarily a pointer to the first pixel in the image or the first pixel in the last line of the image, but merely a base pointer for calculating the address of a pixel using the x- and y-offset tables.

◆ ColumnAt()

Column ColumnAt ( int  x) const
inlinenoexcept

Gets the Vpat::Column at x.

Precondition
x must be between 0 and less than the allowed width.
Parameters
[in]xPixel column.
Returns
Column object at line x.

◆ NewMoved()

Vpat NewMoved ( const Cvb::Rect< int >  newAoi) const
inlinenoexcept

Creates a new, moved linear access object.

Precondition
Valid() == true
Parameters
[in]newAoiOffset and new size in pixels to move this access to.
Returns
New LinearAccess object that is moved by (x, y).

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

Gets whether this vpat access object is valid.

Returns
true if Base() and Vpat() are not nullptr and the origin is valid.

◆ operator()() [1/2]

CVB_FORCE_INLINE const void * operator() ( int  x,
int  y 
) const
inlinenoexcept

Coordinate pixel access operator.

Precondition
Valid() == true
Parameters
[in]xX coordinate coefficient in pixels.
[in]yY coordinate coefficient in pixels.
Returns
Const pointer to pixel value.

◆ operator()() [2/2]

CVB_FORCE_INLINE void * operator() ( int  x,
int  y 
)
inlinenoexcept

Coordinate pixel access operator.

Precondition
Valid() == true
Parameters
[in]xX coordinate coefficient in pixels.
[in]yY coordinate coefficient in pixels.
Returns
Mutable pointer to pixel value.

◆ operator[]() [1/2]

CVB_FORCE_INLINE const void * operator[] ( int  idx) const
inlinenoexcept

Index pixel access operator.

Precondition
Valid() == true
Parameters
[in]idxPixel index.
Returns
Const pointer to pixel value.

◆ operator[]() [2/2]

CVB_FORCE_INLINE void * operator[] ( int  idx)
inlinenoexcept

Index pixel access operator.

Precondition
Valid() == true
Parameters
[in]idxPixel index.
Returns
Mutable pointer to pixel value.

◆ Origin()

Point2D< int > Origin ( ) const
inlinenoexcept

Gets the origin of the Vpat() for this access trait.

This is necessary for sub-blocks to work.

Returns
The origin point of this access trait.

◆ RowAt()

Row RowAt ( int  y) const
inlinenoexcept

Gets the Vpat::Row at y.

Precondition
y must be between 0 and less than the allowed height.
Parameters
[in]yPixel row.
Returns
Row object at line y.

◆ Valid()

bool Valid ( ) const
inlinenoexcept

Gets whether this vpat access object is valid.

Returns
true if Base() and Vpat() are not nullptr and the origin is valid.

◆ VpatPtr()

Entry * VpatPtr ( ) const
inlinenoexcept

Pointer to the native VPAT structure.

Returns
VPAT pointer pointing to the first entry.
Exceptions
Doesnot throw any exception.
See also
Entry

◆ Width()

CVB_FORCE_INLINE int Width ( ) const
inlinenoexcept

Gets the pixel width of the underlying plane.

Returns
Pixel width of the working plane.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const Vpat lhs,
const Vpat rhs 
)
related

Inequality operator.

Parameters
[in]lhsLeft hand side operand.
[in]rhsRight hand side operand.
Returns
true if lhs and rhs are unequal; false if equal.

◆ operator==()

bool operator== ( const Vpat lhs,
const Vpat rhs 
)
related

Equality operator.

Parameters
[in]lhsLeft hand side operand.
[in]rhsRight hand side operand.
Returns
true if lhs and rhs are equal; false if equal.