Abstract data segment class.
More...
#include <DataSegmentBase.h>
|
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...
|
|
icl8u * | getDataPointer () |
| returns the internal (strided) data pointer More...
|
|
const icl8u * | getDataPointer () 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...
|
|
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.
◆ 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.
◆ 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 |
◆ 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 |
◆ operator[]() [2/2]
const Bytes icl::core::DataSegmentBase::operator[] |
( |
int |
idx | ) |
const |
|
inline |
linear index operator (const)
◆ geom::PointCloudObjectBase
for easier integration with the pointcloud object base class
◆ data
icl8u* icl::core::DataSegmentBase::data |
|
protected |
◆ dataDepth
◆ elemDim
size_t icl::core::DataSegmentBase::elemDim |
|
protected |
◆ 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, _};
The documentation for this struct was generated from the following file: