52 #ifndef vpXMLPARSERCAMERA_H
53 #define vpXMLPARSERCAMERA_H
55 #include <visp/vpConfig.h>
60 #include <visp/vpCameraParameters.h>
61 #include <visp/vpXmlParser.h>
62 #include <libxml/xmlmemory.h>
221 } vpXmlCodeSequenceType;
226 std::string camera_name;
227 unsigned int image_width;
228 unsigned int image_height;
229 unsigned int subsampling_width;
230 unsigned int subsampling_height;
231 unsigned int full_width;
232 unsigned int full_height;
235 static const int allowedPixelDiffOnImageSize = 15;
245 const std::string &camera_name,
247 const unsigned int image_width = 0,
const unsigned int image_height = 0);
249 const std::string &camera_name,
250 const unsigned int image_width = 0,
const unsigned int image_height = 0);
254 unsigned int getWidth(){
return this->image_width; }
261 this->camera_name = camera_name;
263 void setWidth(
const unsigned int width){ this->image_width = width ; }
264 void setHeight(
const unsigned int height){ this->image_height = height ; }
266 this->subsampling_width = subsampling_width ;
269 this->subsampling_height = subsampling_height ;
273 int read (xmlDocPtr doc, xmlNodePtr node,
274 const std::string& camera_name,
276 const unsigned int image_width = 0,
277 const unsigned int image_height = 0,
278 const unsigned int subsampling_width = 0,
279 const unsigned int subsampling_height = 0);
281 int count (xmlDocPtr doc, xmlNodePtr node,
282 const std::string& camera_name,
284 const unsigned int image_width = 0,
285 const unsigned int image_height = 0,
286 const unsigned int subsampling_width = 0,
287 const unsigned int subsampling_height = 0);
289 int read_camera (xmlDocPtr doc, xmlNodePtr node,
290 const std::string& camera_name,
292 const unsigned int image_width = 0,
293 const unsigned int image_height = 0,
294 const unsigned int subsampling_width = 0,
295 const unsigned int subsampling_height = 0);
297 xmlNodePtr find_camera (xmlDocPtr doc, xmlNodePtr node,
298 const std::string& camera_name,
299 const unsigned int image_width = 0,
300 const unsigned int image_height = 0,
301 const unsigned int subsampling_width = 0,
302 const unsigned int subsampling_height = 0);
304 vpXmlCodeSequenceType read_camera_model (xmlDocPtr doc, xmlNodePtr node,
307 int read_camera_header (xmlDocPtr doc, xmlNodePtr node,
308 const std::string& camera_name,
309 const unsigned int image_width = 0,
310 const unsigned int image_height = 0,
311 const unsigned int subsampling_width = 0,
312 const unsigned int subsampling_height = 0);
314 static vpXmlCodeSequenceType str2xmlcode (
char * str, vpXmlCodeType & res);
315 void myXmlReadIntChild (xmlDocPtr doc,
318 vpXmlCodeSequenceType &code_error);
320 void myXmlReadDoubleChild (xmlDocPtr doc,
323 vpXmlCodeSequenceType &code_error);
325 void myXmlReadCharChild (xmlDocPtr doc,
328 int write (xmlNodePtr node,
const std::string& camera_name,
329 const unsigned int image_width = 0,
330 const unsigned int image_height = 0,
331 const unsigned int subsampling_width = 0,
332 const unsigned int subsampling_height = 0);
333 int write_camera(xmlNodePtr node_camera);
352 #endif //VISP_HAVE_XML2
void setCameraName(const std::string &camera_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
void setSubsampling_width(const unsigned int subsampling_width)
Generic class defining intrinsic camera parameters.
void setSubsampling_height(const unsigned int subsampling_height)
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)=0
void setWidth(const unsigned int width)
void setHeight(const unsigned int height)
std::string getCameraName()
vpCameraParameters getCameraParameters()
unsigned int getSubsampling_width()
void parse(const std::string &filename)
unsigned int getSubsampling_height()