46 #ifndef vpXMLPARSERCAMERA_H 47 #define vpXMLPARSERCAMERA_H 49 #include <visp3/core/vpConfig.h> 53 #include <libxml/xmlmemory.h> 55 #include <visp3/core/vpCameraParameters.h> 56 #include <visp3/core/vpXmlParser.h> 213 CODE_XML_ADDITIONAL_INFO
220 std::string camera_name;
221 unsigned int image_width;
222 unsigned int image_height;
223 unsigned int subsampling_width;
224 unsigned int subsampling_height;
225 unsigned int full_width;
226 unsigned int full_height;
230 static const int allowedPixelDiffOnImageSize = 15;
244 unsigned int getWidth() {
return this->image_width; }
250 const unsigned int image_height = 0);
253 const unsigned int image_width = 0,
const unsigned int image_height = 0,
254 const std::string &additionalInfo =
"");
257 void setHeight(
const unsigned int height) { this->image_height = height; }
260 void setWidth(
const unsigned int width) { this->image_width = width; }
263 int read(xmlDocPtr doc, xmlNodePtr node,
const std::string &camera_name,
265 const unsigned int image_height = 0,
const unsigned int subsampling_width = 0,
266 const unsigned int subsampling_height = 0);
268 int count(xmlDocPtr doc, xmlNodePtr node,
const std::string &camera_name,
270 const unsigned int image_height = 0,
const unsigned int subsampling_width = 0,
271 const unsigned int subsampling_height = 0);
273 int read_camera(xmlDocPtr doc, xmlNodePtr node,
const std::string &camera_name,
275 const unsigned int image_height = 0,
const unsigned int subsampling_width = 0,
276 const unsigned int subsampling_height = 0);
278 xmlNodePtr find_camera(xmlDocPtr doc, xmlNodePtr node,
const std::string &camera_name,
279 const unsigned int image_width = 0,
const unsigned int image_height = 0,
280 const unsigned int subsampling_width = 0,
const unsigned int subsampling_height = 0);
282 xmlNodePtr find_additional_info(xmlNodePtr node);
284 vpXmlCodeSequenceType read_camera_model(xmlDocPtr doc, xmlNodePtr node,
vpCameraParameters &camera);
286 int read_camera_header(xmlDocPtr doc, xmlNodePtr node,
const std::string &camera_name,
287 const unsigned int image_width = 0,
const unsigned int image_height = 0,
288 const unsigned int subsampling_width = 0,
const unsigned int subsampling_height = 0);
290 static vpXmlCodeSequenceType str2xmlcode(
char *str, vpXmlCodeType &res);
291 void myXmlReadIntChild(xmlDocPtr doc, xmlNodePtr node,
int &res, vpXmlCodeSequenceType &code_error);
293 void myXmlReadDoubleChild(xmlDocPtr doc, xmlNodePtr node,
double &res, vpXmlCodeSequenceType &code_error);
295 void myXmlReadCharChild(xmlDocPtr doc, xmlNodePtr node,
char **res);
296 int write(xmlNodePtr node,
const std::string &camera_name,
const unsigned int image_width = 0,
297 const unsigned int image_height = 0,
const unsigned int subsampling_width = 0,
298 const unsigned int subsampling_height = 0);
299 int write_camera(xmlNodePtr node_camera);
316 #endif // VISP_HAVE_XML2 void setSubsampling_width(const unsigned int subsampling)
void setCameraName(const std::string &name)
virtual void writeMainClass(xmlNodePtr node)=0
XML parser to load and save intrinsic camera parameters.
void save(const std::string &filename, const bool append=false)
This class intends to simplify the creation of xml parser based on the libxml2 third party library...
vpCameraParametersProjType
Generic class defining intrinsic camera parameters.
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)=0
void setWidth(const unsigned int width)
void setSubsampling_height(const unsigned int subsampling)
void setHeight(const unsigned int height)
std::string getCameraName()
vpCameraParameters getCameraParameters()
virtual ~vpXmlParserCamera()
Default destructor.
unsigned int getSubsampling_width()
void parse(const std::string &filename)
unsigned int getSubsampling_height()