CVB++ 14.0
ValueAccessBase< DERIVED > Class Template Reference

Common base class for access traits, providing typed Value access to planes. More...

#include <cvb/vpat.hpp>

Public Member Functions

template<class Type >
const Type & Value (int x, int y) const noexcept
 Gets a pixel value at a given position. More...
 
template<class Type >
Type & Value (int x, int y) noexcept
 Gets a settable pixel value at a given position. More...
 
template<class Type >
const Type & Value (Point2D< int > position) const noexcept
 Gets a pixel value at a given position. More...
 
template<class Type >
Type & Value (Point2D< int > position) noexcept
 Gets a settable pixel value at a given position. More...
 

Detailed Description

template<class DERIVED>
class Cvb::ValueAccessBase< DERIVED >

Common base class for access traits, providing typed Value access to planes.

Template Parameters
DERIVEDThe derived class type following the CRTP pattern The DERIVED type must implement at least a const call operator with {const} void *operator(int x, int y), returning a pointer to the value at the requested position.

Member Function Documentation

◆ Value() [1/4]

const Type & Value ( int  x,
int  y 
) const
inlinenoexcept

Gets a pixel value at a given position.

Parameters
[in]xHorizontal pixel position.
[in]yVertical pixel position.
Returns
Typed readonly reference to the image buffer.
Exceptions
Doesnot throw any exception.

This method is for convenience not for performance.

◆ Value() [2/4]

Type & Value ( int  x,
int  y 
)
inlinenoexcept

Gets a settable pixel value at a given position.

Parameters
[in]xHorizontal pixel position.
[in]yVertical pixel position.
Returns
Typed writable reference to the image buffer.
Exceptions
Doesnot throw any exception.

This method is for convenience not for performance.

◆ Value() [3/4]

const Type & Value ( Point2D< int >  position) const
inlinenoexcept

Gets a pixel value at a given position.

Parameters
[in]positionPixel position.
Returns
Typed read only reference to the image buffer.
Exceptions
Doesnot throw any exception.

This method is for convenience not for performance.

◆ Value() [4/4]

Type & Value ( Point2D< int >  position)
inlinenoexcept

Gets a settable pixel value at a given position.

Parameters
[in]positionPixel position.
Returns
Typed writable reference to the image buffer.
Exceptions
Doesnot throw any exception.

This method is for convenience not for performance.