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>
217 } vpXmlCodeSequenceType;
222 std::string camera_name;
223 unsigned int image_width;
224 unsigned int image_height;
225 unsigned int subsampling_width;
226 unsigned int subsampling_height;
227 unsigned int full_width;
228 unsigned int full_height;
231 static const int allowedPixelDiffOnImageSize = 15;
241 const std::string &camera_name,
243 const unsigned int image_width = 0,
const unsigned int image_height = 0);
245 const std::string &camera_name,
246 const unsigned int image_width = 0,
const unsigned int image_height = 0);
250 unsigned int getWidth(){
return this->image_width; }
257 this->camera_name = name;
259 void setWidth(
const unsigned int width){ this->image_width = width ; }
260 void setHeight(
const unsigned int height){ this->image_height = height ; }
262 this->subsampling_width = subsampling ;
265 this->subsampling_height = subsampling ;
269 int read (xmlDocPtr doc, xmlNodePtr node,
270 const std::string& camera_name,
272 const unsigned int image_width = 0,
273 const unsigned int image_height = 0,
274 const unsigned int subsampling_width = 0,
275 const unsigned int subsampling_height = 0);
277 int count (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 read_camera (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 xmlNodePtr find_camera (xmlDocPtr doc, xmlNodePtr node,
294 const std::string& camera_name,
295 const unsigned int image_width = 0,
296 const unsigned int image_height = 0,
297 const unsigned int subsampling_width = 0,
298 const unsigned int subsampling_height = 0);
300 vpXmlCodeSequenceType read_camera_model (xmlDocPtr doc, xmlNodePtr node,
303 int read_camera_header (xmlDocPtr doc, xmlNodePtr node,
304 const std::string& camera_name,
305 const unsigned int image_width = 0,
306 const unsigned int image_height = 0,
307 const unsigned int subsampling_width = 0,
308 const unsigned int subsampling_height = 0);
310 static vpXmlCodeSequenceType str2xmlcode (
char * str, vpXmlCodeType & res);
311 void myXmlReadIntChild (xmlDocPtr doc,
314 vpXmlCodeSequenceType &code_error);
316 void myXmlReadDoubleChild (xmlDocPtr doc,
319 vpXmlCodeSequenceType &code_error);
321 void myXmlReadCharChild (xmlDocPtr doc,
324 int write (xmlNodePtr node,
const std::string& camera_name,
325 const unsigned int image_width = 0,
326 const unsigned int image_height = 0,
327 const unsigned int subsampling_width = 0,
328 const unsigned int subsampling_height = 0);
329 int write_camera(xmlNodePtr node_camera);
348 #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()
unsigned int getSubsampling_width()
void parse(const std::string &filename)
unsigned int getSubsampling_height()