Static Public Member Functions | Static Private Member Functions | List of all members
alvar::FileFormatUtils Class Reference

Utility functions for file reading / writing. More...

#include <FileFormatUtils.h>

Static Public Member Functions

static CvMat * allocateXMLMatrix (const TiXmlElement *xml_matrix)
 Allocates CvMat of a correct type and size. More...
 
static TiXmlElement * createXMLMatrix (const char *element_name, const CvMat *matrix)
 Allocates new XML element and populates it with a CvMat data. More...
 
static bool parseXMLMatrix (const TiXmlElement *xml_matrix, CvMat *matrix)
 Reads contents of alvar:matrix into CvMat. More...
 

Static Private Member Functions

static bool decodeXMLMatrix (const TiXmlElement *xml_matrix, int &type, int &rows, int &cols)
 Reads matrix type, rows and cols from XML element. More...
 

Detailed Description

Utility functions for file reading / writing.

Definition at line 42 of file FileFormatUtils.h.

Member Function Documentation

CvMat * alvar::FileFormatUtils::allocateXMLMatrix ( const TiXmlElement *  xml_matrix)
static

Allocates CvMat of a correct type and size.

Parameters
xml_matrixalvar:matrix element.
Returns
CvMat that has the correct size for parseXMLMatrix.

Definition at line 43 of file FileFormatUtils.cpp.

TiXmlElement * alvar::FileFormatUtils::createXMLMatrix ( const char *  element_name,
const CvMat *  matrix 
)
static

Allocates new XML element and populates it with a CvMat data.

The returned element needs to be deallocated by the caller.

Parameters
element_nameName of the allocated tiXmlElement.
matrixData that is written into the returned XML element.
Returns
Newly allocated TiXmlElement.

Definition at line 75 of file FileFormatUtils.cpp.

bool alvar::FileFormatUtils::decodeXMLMatrix ( const TiXmlElement *  xml_matrix,
int &  type,
int &  rows,
int &  cols 
)
staticprivate

Reads matrix type, rows and cols from XML element.

Returns
true if XML element appears to be valid; otherwise false.

Definition at line 31 of file FileFormatUtils.cpp.

bool alvar::FileFormatUtils::parseXMLMatrix ( const TiXmlElement *  xml_matrix,
CvMat *  matrix 
)
static

Reads contents of alvar:matrix into CvMat.

Parsing fails if the matrix is not the same type or does not have the same number of rows and columns as the XML element.

Parameters
xml_matrixalvar:matrix element. If NULL no parsing is done and false is returned.
matrixCvMat that has the correct size, populated with data in the xml_matrix.
Returns
true if matrix was successfully parsed; otherwise false.

Definition at line 52 of file FileFormatUtils.cpp.


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


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Thu Jun 6 2019 19:27:24