stromx  0.8.0
Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | List of all members
stromx::runtime::Matrix Class Referenceabstract

Abstract image. More...

#include <Matrix.h>

Inheritance diagram for stromx::runtime::Matrix:
stromx::runtime::Data stromx::runtime::DataInterface stromx::runtime::Image stromx::runtime::MatrixWrapper stromx::runtime::ImageWrapper stromx::cvsupport::Matrix stromx::cvsupport::Image

Public Types

enum  ValueType {
  NONE, INT_8, UINT_8, INT_16,
  UINT_16, INT_32, UINT_32, FLOAT_32,
  FLOAT_64
}
 

Public Member Functions

virtual uint8_t * buffer ()=0
 
virtual unsigned int bufferSize () const =0
 
virtual unsigned int rows () const =0
 
virtual unsigned int cols () const =0
 
virtual unsigned int stride () const =0
 
virtual ValueType valueType () const =0
 
virtual unsigned int valueSize () const
 
virtual uint8_t * data ()=0
 
virtual const uint8_t * data () const =0
 
virtual void initializeMatrix (const unsigned int rows, const unsigned int cols, const unsigned int stride, uint8_t *data, const ValueType valueType)=0
 
template<class T >
T & at (const unsigned row, const unsigned col)
 
template<class T >
const T & at (const unsigned int row, const unsigned col) const
 
template<class T >
const T value (const unsigned int row, const unsigned int col) const
 
- Public Member Functions inherited from stromx::runtime::Data
virtual void serialize (OutputProvider &out) const
 
virtual void deserialize (InputProvider &in, const Version &version)
 
- Public Member Functions inherited from stromx::runtime::DataInterface
virtual const Versionversion () const =0
 
virtual const std::string & type () const =0
 
virtual const std::string & package () const =0
 
virtual const VariantHandlevariant () const =0
 
virtual Dataclone () const =0
 
bool isVariant (const VariantInterface &v) const
 

Static Public Member Functions

static unsigned int valueSize (const ValueType valueType)
 

Static Protected Member Functions

static const runtime::VariantHandle dataVariantFromValueType (const ValueType valueType)
 

Detailed Description

Abstract image.

Member Function Documentation

§ at() [1/2]

template<class T >
T& stromx::runtime::Matrix::at ( const unsigned  row,
const unsigned  col 
)
inline

Returns a reference of type T to the value at the position (row, col).

Exceptions
WrongArgumentIf the size of T does not match the value size of the matrix or if the given position is not within the matrix bounds.

§ at() [2/2]

template<class T >
const T& stromx::runtime::Matrix::at ( const unsigned int  row,
const unsigned  col 
) const
inline

Returns a constant reference of type T to the value at the position (row, col).

Exceptions
WrongArgumentIf the size of T does not match the value size of the matrix or if the given position is not within the matrix bounds.

§ buffer()

virtual uint8_t* stromx::runtime::Matrix::buffer ( )
pure virtual

Returns the address of the buffer of the matrix. This is not necessarily a pointer to the matrix data which can be located at a different position in the buffer.

Implemented in stromx::runtime::MatrixWrapper, and stromx::runtime::ImageWrapper.

§ bufferSize()

virtual unsigned int stromx::runtime::Matrix::bufferSize ( ) const
pure virtual

Returns the size of the buffer.

Implemented in stromx::runtime::MatrixWrapper, and stromx::runtime::ImageWrapper.

§ cols()

virtual unsigned int stromx::runtime::Matrix::cols ( ) const
pure virtual

Returns the number columns of the matrix.

Implemented in stromx::runtime::MatrixWrapper, and stromx::runtime::ImageWrapper.

§ data() [1/2]

virtual uint8_t* stromx::runtime::Matrix::data ( )
pure virtual

Returns the address of the matrix data.

Implemented in stromx::runtime::MatrixWrapper, and stromx::runtime::ImageWrapper.

§ data() [2/2]

virtual const uint8_t* stromx::runtime::Matrix::data ( ) const
pure virtual

Returns the address of the matrix data as a constant pointer.

Implemented in stromx::runtime::MatrixWrapper, and stromx::runtime::ImageWrapper.

§ dataVariantFromValueType()

const runtime::VariantHandle stromx::runtime::Matrix::dataVariantFromValueType ( const ValueType  valueType)
staticprotected

Returns the data variant defined by the input valueType.

§ initializeMatrix()

virtual void stromx::runtime::Matrix::initializeMatrix ( const unsigned int  rows,
const unsigned int  cols,
const unsigned int  stride,
uint8_t *  data,
const ValueType  valueType 
)
pure virtual

Initializes the matrix to the given data. Note that this function does not change the matrix buffer but merely changes the description of the data contained in the matrix buffer.

Implemented in stromx::cvsupport::Image, stromx::runtime::MatrixWrapper, and stromx::runtime::ImageWrapper.

§ rows()

virtual unsigned int stromx::runtime::Matrix::rows ( ) const
pure virtual

Returns the number of rows of the matrix.

Implemented in stromx::runtime::MatrixWrapper, and stromx::runtime::ImageWrapper.

§ stride()

virtual unsigned int stromx::runtime::Matrix::stride ( ) const
pure virtual

Returns the size of a row in the matrix in bytes.

Implemented in stromx::runtime::Image, stromx::runtime::MatrixWrapper, and stromx::runtime::ImageWrapper.

§ value()

template<class T >
const T stromx::runtime::Matrix::value ( const unsigned int  row,
const unsigned int  col 
) const
inline

Returns a copy of type T of the value at the position (row, col). The value is casted to T by a static cast.

§ valueSize() [1/2]

unsigned int stromx::runtime::Matrix::valueSize ( ) const
virtual

Returns the size of a single value in bytes.

Reimplemented in stromx::runtime::ImageWrapper.

§ valueSize() [2/2]

unsigned int stromx::runtime::Matrix::valueSize ( const ValueType  valueType)
static

Returns the size of a single value of type valueType in bytes.

§ valueType()

virtual ValueType stromx::runtime::Matrix::valueType ( ) const
pure virtual

Returns the value type of the data of the matrix.

Implemented in stromx::runtime::MatrixWrapper, and stromx::runtime::ImageWrapper.


The documentation for this class was generated from the following files: