Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
tutorial-image-reader.cpp
1 
2 #include <visp3/io/vpImageIo.h>
3 
4 int main()
5 {
6  try {
8  vpImageIo::read(I, "monkey.jpeg");
9  vpImageIo::write(I, "monkey.png");
10  }
11  catch(vpException &e) {
12  std::cout << e.getMessage() << std::endl;
13  }
14  catch(...) {
15  std::cout << "Unsupported image format" << std::endl;
16  }
17 }
18 
error that can be emited by ViSP classes.
Definition: vpException.h:73
static void write(const vpImage< unsigned char > &I, const std::string &filename)
Definition: vpImageIo.cpp:368
const char * getMessage(void) const
Definition: vpException.cpp:97
static void read(vpImage< unsigned char > &I, const std::string &filename)
Definition: vpImageIo.cpp:205