CVB++ 15.0
BlockBase< AccessTrait > Class Template Reference

Base class for all typed Cvb::Block types. More...

#include <cvb/block.hpp>

Public Member Functions

CVB_FORCE_INLINE const AccessTrait & Access () const noexcept
 Gets the pixel access. More...
 
CVB_FORCE_INLINE AccessTrait & Access () noexcept
 Gets the pixel access. More...
 
CVB_FORCE_INLINE size_t Length () const noexcept
 Gets the total number of pixels in this block. More...
 
CVB_FORCE_INLINE Size2D< int > Size () const noexcept
 Gets the size of this block. More...
 
CVB_FORCE_INLINE int Width () const noexcept
 Gets the width of this block. More...
 
CVB_FORCE_INLINE int Height () const noexcept
 Gets the height of this block. More...
 
bool Valid () const noexcept
 Gets whether this block is valid. More...
 

Detailed Description

template<class AccessTrait>
class Cvb::BlockBase< AccessTrait >

Base class for all typed Cvb::Block types.

This base class contains the common, untyped methods of the Cvb::Block to reduce binary size.

Template Parameters
AccessTraitTrait to access a coordinate.

Member Function Documentation

◆ Access() [1/2]

CVB_FORCE_INLINE const AccessTrait & Access ( ) const
inlinenoexcept

Gets the pixel access.

Returns
Const reference to the Access object.

◆ Access() [2/2]

CVB_FORCE_INLINE AccessTrait & Access ( )
inlinenoexcept

Gets the pixel access.

Returns
Mutable reference to the Access object.

◆ Height()

CVB_FORCE_INLINE int Height ( ) const
inlinenoexcept

Gets the height of this block.

Returns
The height in pixels.

◆ Length()

CVB_FORCE_INLINE size_t Length ( ) const
inlinenoexcept

Gets the total number of pixels in this block.

This is effectively Size().Width() * Size().Height().

Returns
The total number of pixels in this block.

◆ Size()

CVB_FORCE_INLINE Size2D< int > Size ( ) const
inlinenoexcept

Gets the size of this block.

Returns
The size in pixels.

◆ Valid()

bool Valid ( ) const
inlinenoexcept

Gets whether this block is valid.

Returns
true if Size() is not empty and the access is valid.

◆ Width()

CVB_FORCE_INLINE int Width ( ) const
inlinenoexcept

Gets the width of this block.

Returns
The width in pixels.