Image Component Library (ICL)
Classes | Public Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
icl::core::DataSegmentBase Struct Reference

Abstract data segment class. More...

#include <DataSegmentBase.h>

Inheritance diagram for icl::core::DataSegmentBase:
icl::core::DataSegment< float, 2 > icl::core::DataSegment< float, 4 > icl::core::DataSegment< T, N > icl::core::DataSegment< T, 1 >

Classes

class  Bytes
 Very simple Byte Vector class to provide binary access to DataSegmentBase data. More...
 

Public Member Functions

bool isOrganized () const
 returns, whether the segment is 2D-organized More...
 
utils::Size getSize () const
 returns the ordred size of the segment of utils::Size::null if it's not organized More...
 
int getStride () const
 returns the internal stride used More...
 
int getDim () const
 returns the number of elements More...
 
core::depth getDepth () const
 returns the actual core::depth (data type) of the entries More...
 
int getElemDim () const
 returns the dimension of the contained elements More...
 
icl8ugetDataPointer ()
 returns the internal (strided) data pointer More...
 
const icl8ugetDataPointer () const
 returns the internal (strided) data pointer More...
 
 DataSegmentBase (void *data=0, size_t stride=0, size_t numElements=0, icl32s organizedWidth=-1, core::depth dataDepth=core::depth8u, size_t elemDim=0)
 Constructor with given parameters. More...
 
template<class T , int N>
const DataSegment< T, N > & as () const
 shallow and save cast from data segment base to special data segment version More...
 
Bytes operator[] (int idx)
 linear index operator More...
 
const Bytes operator[] (int idx) const
 linear index operator (const) More...
 
Bytes operator() (int x, int y)
 2D-index operator (only for organized data segments) More...
 
const Bytes operator() (int x, int y) const
 2D-index operator (only for organized data segments, const) More...
 

Static Protected Member Functions

static int getSizeOf (core::depth d)
 associcates a core::depth values and the (byte)-size of the corresponding type More...
 

Protected Attributes

icl8udata
 data pointer orign More...
 
size_t stride
 stride between elements More...
 
size_t numElements
 number of vector elements contained More...
 
icl32s organizedWidth
 if > 0 , the data is 2D-organized More...
 
core::depth dataDepth
 underlying data depth More...
 
size_t elemDim
 vector element dim More...
 

Friends

class geom::PointCloudObjectBase
 for easier integration with the pointcloud object base class More...
 

Detailed Description

Abstract data segment class.

The DataSegmentBase class is a generic base class for interleaved data sets. It is use as a base class for all versions of the DataSegment class template. While the the latter provides typesave access to all data entries, the DataSegmentBase class provides runtime information about the actual type. The DataSegmentBase::as template method can be used for a type-checked cast into an actual DataSegment type, which provides type-safe access to the reference data.

Constructor & Destructor Documentation

◆ DataSegmentBase()

icl::core::DataSegmentBase::DataSegmentBase ( void *  data = 0,
size_t  stride = 0,
size_t  numElements = 0,
icl32s  organizedWidth = -1,
core::depth  dataDepth = core::depth8u,
size_t  elemDim = 0 
)
inline

Constructor with given parameters.

Member Function Documentation

◆ as()

template<class T , int N>
const DataSegment<T,N>& icl::core::DataSegmentBase::as ( ) const

shallow and save cast from data segment base to special data segment version

This function performs a save shallow cast, by evaluating runtime core::depth and dim parameters to throw an instance of utils::ICLException if the targetet type is not compatible

Please note: this function can only be defined after the DataSegment template class definition is available, so you can find it after that class,

◆ getDataPointer() [1/2]

icl8u* icl::core::DataSegmentBase::getDataPointer ( )
inline

returns the internal (strided) data pointer

only for those who know what they are doing

◆ getDataPointer() [2/2]

const icl8u* icl::core::DataSegmentBase::getDataPointer ( ) const
inline

returns the internal (strided) data pointer

only for those who know what they are doing

◆ getDepth()

core::depth icl::core::DataSegmentBase::getDepth ( ) const
inline

returns the actual core::depth (data type) of the entries

◆ getDim()

int icl::core::DataSegmentBase::getDim ( ) const
inline

returns the number of elements

If the data is 2D-organized, than width*height is returned

◆ getElemDim()

int icl::core::DataSegmentBase::getElemDim ( ) const
inline

returns the dimension of the contained elements

◆ getSize()

utils::Size icl::core::DataSegmentBase::getSize ( ) const
inline

returns the ordred size of the segment of utils::Size::null if it's not organized

◆ getSizeOf()

static int icl::core::DataSegmentBase::getSizeOf ( core::depth  d)
inlinestaticprotected

associcates a core::depth values and the (byte)-size of the corresponding type

◆ getStride()

int icl::core::DataSegmentBase::getStride ( ) const
inline

returns the internal stride used

◆ isOrganized()

bool icl::core::DataSegmentBase::isOrganized ( ) const
inline

returns, whether the segment is 2D-organized

◆ operator()() [1/2]

Bytes icl::core::DataSegmentBase::operator() ( int  x,
int  y 
)
inline

2D-index operator (only for organized data segments)

◆ operator()() [2/2]

const Bytes icl::core::DataSegmentBase::operator() ( int  x,
int  y 
) const
inline

2D-index operator (only for organized data segments, const)

◆ operator[]() [1/2]

Bytes icl::core::DataSegmentBase::operator[] ( int  idx)
inline

linear index operator

◆ operator[]() [2/2]

const Bytes icl::core::DataSegmentBase::operator[] ( int  idx) const
inline

linear index operator (const)

Friends And Related Function Documentation

◆ geom::PointCloudObjectBase

friend class geom::PointCloudObjectBase
friend

for easier integration with the pointcloud object base class

Member Data Documentation

◆ data

icl8u* icl::core::DataSegmentBase::data
protected

data pointer orign

◆ dataDepth

core::depth icl::core::DataSegmentBase::dataDepth
protected

underlying data depth

◆ elemDim

size_t icl::core::DataSegmentBase::elemDim
protected

vector element dim

◆ numElements

size_t icl::core::DataSegmentBase::numElements
protected

number of vector elements contained

◆ organizedWidth

icl32s icl::core::DataSegmentBase::organizedWidth
protected

if > 0 , the data is 2D-organized

◆ stride

size_t icl::core::DataSegmentBase::stride
protected

stride between elements

The stride defines the number of bytes, one has to jump, to get from one vector start to the next start. The unit is byte E.g.

float data[2*4] = {x,y,z,_, x,y,z, _}; // -> stride = 4*sizeof(float)

The documentation for this struct was generated from the following file: