48 #ifndef vpXMLPARSERCAMERA_H
49 #define vpXMLPARSERCAMERA_H
51 #include <visp3/core/vpConfig.h>
56 #include <visp3/core/vpCameraParameters.h>
57 #include <visp3/core/vpXmlParser.h>
58 #include <libxml/xmlmemory.h>
214 CODE_XML_ADDITIONAL_INFO
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;
250 unsigned int getWidth(){
return this->image_width; }
255 const std::string &camera_name,
257 const unsigned int image_width = 0,
const unsigned int image_height = 0);
260 const std::string &camera_name,
261 const unsigned int image_width = 0,
const unsigned int image_height = 0,
262 const std::string &additionalInfo=
"");
265 this->camera_name = name;
267 void setHeight(
const unsigned int height){ this->image_height = height ; }
269 this->subsampling_width = subsampling ;
272 this->subsampling_height = subsampling ;
274 void setWidth(
const unsigned int width){ this->image_width = width ; }
277 int read (xmlDocPtr doc, xmlNodePtr node,
278 const std::string& camera_name,
280 const unsigned int image_width = 0,
281 const unsigned int image_height = 0,
282 const unsigned int subsampling_width = 0,
283 const unsigned int subsampling_height = 0);
285 int count (xmlDocPtr doc, xmlNodePtr node,
286 const std::string& camera_name,
288 const unsigned int image_width = 0,
289 const unsigned int image_height = 0,
290 const unsigned int subsampling_width = 0,
291 const unsigned int subsampling_height = 0);
293 int read_camera (xmlDocPtr doc, xmlNodePtr node,
294 const std::string& camera_name,
296 const unsigned int image_width = 0,
297 const unsigned int image_height = 0,
298 const unsigned int subsampling_width = 0,
299 const unsigned int subsampling_height = 0);
301 xmlNodePtr find_camera (xmlDocPtr doc, xmlNodePtr node,
302 const std::string& camera_name,
303 const unsigned int image_width = 0,
304 const unsigned int image_height = 0,
305 const unsigned int subsampling_width = 0,
306 const unsigned int subsampling_height = 0);
308 xmlNodePtr find_additional_info (xmlNodePtr node);
310 vpXmlCodeSequenceType read_camera_model (xmlDocPtr doc, xmlNodePtr node,
313 int read_camera_header (xmlDocPtr doc, xmlNodePtr node,
314 const std::string& camera_name,
315 const unsigned int image_width = 0,
316 const unsigned int image_height = 0,
317 const unsigned int subsampling_width = 0,
318 const unsigned int subsampling_height = 0);
320 static vpXmlCodeSequenceType str2xmlcode (
char * str, vpXmlCodeType & res);
321 void myXmlReadIntChild (xmlDocPtr doc,
324 vpXmlCodeSequenceType &code_error);
326 void myXmlReadDoubleChild (xmlDocPtr doc,
329 vpXmlCodeSequenceType &code_error);
331 void myXmlReadCharChild (xmlDocPtr doc,
334 int write (xmlNodePtr node,
const std::string& camera_name,
335 const unsigned int image_width = 0,
336 const unsigned int image_height = 0,
337 const unsigned int subsampling_width = 0,
338 const unsigned int subsampling_height = 0);
339 int write_camera(xmlNodePtr node_camera);
358 #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()