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. | |
| static TiXmlElement * | createXMLMatrix (const char *element_name, const CvMat *matrix) |
| Allocates new XML element and populates it with a CvMat data. | |
| static bool | parseXMLMatrix (const TiXmlElement *xml_matrix, CvMat *matrix) |
| Reads contents of alvar:matrix into CvMat. | |
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. | |
Utility functions for file reading / writing.
Definition at line 42 of file FileFormatUtils.h.
| CvMat * alvar::FileFormatUtils::allocateXMLMatrix | ( | const TiXmlElement * | xml_matrix | ) | [static] |
Allocates CvMat of a correct type and size.
| xml_matrix | alvar:matrix element. |
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.
| element_name | Name of the allocated tiXmlElement. |
| matrix | Data that is written into the returned XML element. |
Definition at line 75 of file FileFormatUtils.cpp.
| bool alvar::FileFormatUtils::decodeXMLMatrix | ( | const TiXmlElement * | xml_matrix, |
| int & | type, | ||
| int & | rows, | ||
| int & | cols | ||
| ) | [static, private] |
Reads matrix type, rows and cols from XML element.
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.
| xml_matrix | alvar:matrix element. If NULL no parsing is done and false is returned. |
| matrix | CvMat that has the correct size, populated with data in the xml_matrix. |
Definition at line 52 of file FileFormatUtils.cpp.