CVB++ 14.0
ScatterAccess< K > Class Template Reference

Access trait for multiple, possibly scattered planes. More...

#include <cvb/vpat.hpp>

Classes

class  Column
 A single column. More...
 
class  Row
 A single row. More...
 

Public Member Functions

 ScatterAccess (const ScatterAccess &other) noexcept
 Default copy ctor.
 
ScatterAccessoperator= (const ScatterAccess &other) noexcept
 Copy assignment operator. More...
 
constexpr size_t PlanesCount () const
 Gets the number of planes stored. More...
 
ScatterAccess< K > NewMoved (const Cvb::Rect< int > newAoi) const noexcept
 Creates a new, moved scatter access object. More...
 
bool Valid () const noexcept
 Gets whether the aggregated access objects are all valid. More...
 
 operator bool () const noexcept
 Gets whether the aggregated access objects are all valid. More...
 
std::array< const void *, K > operator() (int x, int y) const noexcept
 Coordinate pixel access operator. More...
 
std::array< void *, K > operator() (int x, int y) noexcept
 Coordinate pixel access operator. More...
 
std::array< const void *, K > operator[] (int idx) const noexcept
 Index pixel access operator. More...
 
std::array< void *, K > operator[] (int idx) noexcept
 Index pixel access operator. More...
 
Row RowAt (int y) const
 Gets the Row at line y. More...
 
Column ColumnAt (int x) const
 Gets the Column at x. More...
 

Static Public Member Functions

template<class... ACCESSES>
static ScatterAccess< K > FromAccess (ACCESSES &&... planeAccesses)
 Creates a ScatterAccess from the given access planes. More...
 

Related Functions

(Note that these are not member functions.)

template<class... ACCESSES>
auto MakeStaticScatterAccess (ACCESSES &&... planeAccesses) -> ScatterAccess< sizeof...(ACCESSES)>
 Creates a static scatter access with the given planes. More...
 

Detailed Description

template<int K>
class Cvb::ScatterAccess< K >

Access trait for multiple, possibly scattered planes.

Template Parameters
KNumber of planes to aggregate; Dynamic for runtime variable number of planes.

Member Function Documentation

◆ ColumnAt()

Column ColumnAt ( int  x) const
inline

Gets the Column at x.

Parameters
[in]xColumn to get.
Returns
Column object.

◆ FromAccess()

static ScatterAccess< K > FromAccess ( ACCESSES &&...  planeAccesses)
inlinestatic

Creates a ScatterAccess from the given access planes.

Note
The number of objects in the planes parameter pack must be equal to K.
Parameters
[in]planeAccessesPlane access objects.
Returns
Newly created ScatterAccess object.

◆ NewMoved()

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

Creates a new, moved scatter access object.

Precondition
Valid() == true
Parameters
[in]newAoiOffset and new size in pixels to move this scatter access to.
Returns
New ScatterAccess object that is moved by (newAoi.Left(), newAoi.Top()).

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

Gets whether the aggregated access objects are all valid.

Returns
true if all plane access objects are valid; false otherwise.

◆ operator()() [1/2]

std::array< const void *, K > 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
Array of const pointers to pixel's components.

◆ operator()() [2/2]

std::array< void *, K > 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
Array of mutable pointers to pixel's components.

◆ operator=()

ScatterAccess & operator= ( const ScatterAccess< K > &  other)
inlinenoexcept

Copy assignment operator.

Returns
Reference to this object.

◆ operator[]() [1/2]

std::array< const void *, K > operator[] ( int  idx) const
inlinenoexcept

Index pixel access operator.

Precondition
Valid() == true
Parameters
[in]idxPixel index.
Returns
Array of const pointers to pixel's components.

◆ operator[]() [2/2]

std::array< void *, K > operator[] ( int  idx)
inlinenoexcept

Index pixel access operator.

Precondition
Valid() == true
Parameters
[in]idxPixel index.
Returns
Array of mutable pointers to pixel's components.

◆ PlanesCount()

constexpr size_t PlanesCount ( ) const
inlineconstexpr

Gets the number of planes stored.

Returns
Effectively returns K.

◆ RowAt()

Row RowAt ( int  y) const
inline

Gets the Row at line y.

Parameters
[in]yLine of row to get.
Returns
Row object.

◆ Valid()

bool Valid ( ) const
inlinenoexcept

Gets whether the aggregated access objects are all valid.

Returns
true if all plane access objects are valid; false otherwise.

Friends And Related Function Documentation

◆ MakeStaticScatterAccess()

auto MakeStaticScatterAccess ( ACCESSES &&...  planeAccesses) -> ScatterAccess<sizeof...(ACCESSES)>
related

Creates a static scatter access with the given planes.

Parameters
[in]planeAccessesPlanes to make scatter access of.
Returns
Newly created ScatterAccess object.