File: tutorial-image-reader.cpp

package info (click to toggle)
visp 3.6.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 119,296 kB
  • sloc: cpp: 500,914; ansic: 52,904; xml: 22,642; python: 7,365; java: 4,247; sh: 482; makefile: 237; objc: 145
file content (15 lines) | stat: -rw-r--r-- 360 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*! \example tutorial-image-reader.cpp */
#include <visp3/io/vpImageIo.h>

int main()
{
  try {
    vpImage<vpRGBa> I;
    vpImageIo::read(I, "monkey.jpeg");
    vpImageIo::write(I, "monkey.png");
  } catch (const vpException &e) {
    std::cout << e.getMessage() << std::endl;
  } catch (...) {
    std::cout << "Unsupported image format" << std::endl;
  }
}