Flair
Framework Libre Air
flair::core::cvmatrix Class Reference

Class defining a matrix of kind CvMat. More...

#include <cvmatrix.h>

+ Inheritance diagram for flair::core::cvmatrix:

Classes

class  Type
 

Public Member Functions

 cvmatrix (const Object *parent, const cvmatrix_descriptor *descriptor, ScalarType const &elementDataType, std::string name="", uint32_t n=1)
 Constructor. More...
 
 cvmatrix (const Object *parent, uint32_t rows, uint32_t cols, ScalarType const &elementDataType, std::string name="", uint32_t n=1)
 Constructor. More...
 
 ~cvmatrix ()
 Destructor. More...
 
float Value (uint32_t row, uint32_t col) const
 Element value. More...
 
float ValueNoMutex (uint32_t row, uint32_t col) const
 Element value. More...
 
void SetValue (uint32_t row, uint32_t col, float value)
 Set element value. More...
 
void SetValueNoMutex (uint32_t row, uint32_t col, float value)
 Set element value. More...
 
CvMat * getCvMat (void) const
 get CvMat More...
 
std::string Name (uint32_t row, uint32_t col) const
 Element name. More...
 
IODataElementElement (uint32_t row, uint32_t col) const
 Element. More...
 
IODataElementElement (uint32_t index) const
 Element. More...
 
uint32_t Rows (void) const
 Number of rows. More...
 
uint32_t Cols (void) const
 Number of colomns. More...
 
Type const & GetDataType () const
 
- Public Member Functions inherited from flair::core::io_data
 io_data (const Object *parent, std::string name, int n)
 Constructor. More...
 
virtual ~io_data ()
 Destructor. More...
 
void SetDataTime (Time time)
 Set data time. More...
 
Time DataTime (void) const
 Data time. More...
 
const io_dataPrev (int n) const
 Previous data. More...
 
- Public Member Functions inherited from flair::core::Mutex
 Mutex (const Object *parent, std::string name="")
 Constructor. More...
 
 ~Mutex ()
 Destructor. More...
 
void GetMutex (void) const
 GetMutex. More...
 
void ReleaseMutex (void) const
 ReleaseMutex. More...
 
- Public Member Functions inherited from flair::core::Object
 Object (const Object *parent=NULL, std::string name="", std::string type="")
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
std::string ObjectName (void) const
 Name. More...
 
std::string ObjectType (void) const
 Type. More...
 
const ObjectParent (void) const
 Parent. More...
 
std::vector< const Object * > * TypeChilds (void) const
 Childs of the same type. More...
 
std::vector< const Object * > * Childs (void) const
 Childs. More...
 
void Information (const char *function, int line, const char *format,...) const
 Formatted information. More...
 
void Warning (const char *function, const char *format,...) const
 Formatted warning. More...
 
void Error (const char *function, const char *format,...) const
 Formatted error. More...
 
bool ErrorOccured (bool recursive=true) const
 Has an errror occured? More...
 

Additional Inherited Members

- Public Types inherited from flair::core::Object
enum  color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 }
 
- Protected Member Functions inherited from flair::core::io_data
void AppendLogDescription (std::string description, DataType const &datatype)
 Specify the description of the reimplemented class data's. More...
 
void SetPtrToCircle (void **ptr)
 Set the datas to circle. More...
 
- Protected Attributes inherited from flair::core::io_data
io_dataprev
 Pointer to previous data. More...
 

Detailed Description

Class defining a matrix of kind CvMat.

CvMat is a matrix struct defined in OpenCV.

Constructor & Destructor Documentation

flair::core::cvmatrix::cvmatrix ( const Object parent,
const cvmatrix_descriptor descriptor,
ScalarType const &  elementDataType,
std::string  name = "",
uint32_t  n = 1 
)

Constructor.

Construct an io_data representing a CvMat.
It uses a cvmatrix_descriptor to get size and elements' names.
Names are used for graphs and logs.

Parameters
parentparent
descriptormatrix description
typetype of matrix elements
namename
nnumber of samples
flair::core::cvmatrix::cvmatrix ( const Object parent,
uint32_t  rows,
uint32_t  cols,
ScalarType const &  elementDataType,
std::string  name = "",
uint32_t  n = 1 
)

Constructor.

Construct an io_data representing a CvMat.
Elements are unamed.

Parameters
parentparent
rowsmatrix rows
colsmatrix cols
typetype of matrix elements
namename
nnumber of samples
flair::core::cvmatrix::~cvmatrix ( )

Destructor.

Member Function Documentation

float flair::core::cvmatrix::Value ( uint32_t  row,
uint32_t  col 
) const

Element value.

Element is accessed by locking and unlocking the io_data Mutex.

Parameters
rowelement row
colelement col
Returns
element value
float flair::core::cvmatrix::ValueNoMutex ( uint32_t  row,
uint32_t  col 
) const

Element value.

Element is not accessed by locking and unlocking the io_data Mutex.
Thus, this function should be called with Mutex locked.
This function is usefull when multiple successive access are done to the elments of the matrix. It avoids unnecessary locking and unlocking.

Parameters
rowelement row
colelement col
Returns
element value
void flair::core::cvmatrix::SetValue ( uint32_t  row,
uint32_t  col,
float  value 
)

Set element value.

Element is accessed by locking and unlocking the io_data Mutex.

Parameters
rowelement row
colelement col
valueelement value
void flair::core::cvmatrix::SetValueNoMutex ( uint32_t  row,
uint32_t  col,
float  value 
)

Set element value.

Element is not accessed by locking and unlocking the io_data Mutex.
Thus, this function should be called with Mutex locked.
This function is usefull when multiple successive access are done to the elments of the matrix. It avoids unnecessary locking and unlocking.

Parameters
rowelement row
colelement col
valueelement value
CvMat* flair::core::cvmatrix::getCvMat ( void  ) const

get CvMat

The io_data Mutex must be used by the user.

std::string flair::core::cvmatrix::Name ( uint32_t  row,
uint32_t  col 
) const

Element name.

If cvmatrix was created without cvmatrix_descriptor, element name is empty.

Parameters
rowelement row
colelement col
Returns
element name
IODataElement* flair::core::cvmatrix::Element ( uint32_t  row,
uint32_t  col 
) const

Element.

Get a pointer to a specific element. This pointer can be used for plotting.

Parameters
rowelement row
colelement col
Returns
pointer to the element
IODataElement* flair::core::cvmatrix::Element ( uint32_t  index) const

Element.

Get a pointer to a specific element. This pointer can be used for plotting.
This function can be used for a 1D matrix.

Parameters
indexelement index
Returns
pointer to the element
uint32_t flair::core::cvmatrix::Rows ( void  ) const

Number of rows.

Returns
rows
uint32_t flair::core::cvmatrix::Cols ( void  ) const

Number of colomns.

Returns
colomns