1 #include <visp/vpDisplayX.h>
3 #include <visp/vpImage.h>
7 main(
int argc,
const char **argv )
11 bool opt_use_camera_info =
false;
12 for (
int i = 0; i < argc; i++ )
14 if ( std::string( argv[i] ) ==
"--use-camera-info" )
15 opt_use_camera_info =
true;
16 else if ( std::string( argv[i] ) ==
"--help" )
18 std::cout <<
"Usage: " << argv[0] <<
" [--use-camera-info] [--help]" << std::endl;
22 std::cout <<
"Use camera info: " << ( ( opt_use_camera_info == true ) ?
"yes" :
"no" ) << std::endl;
34 if ( opt_use_camera_info )
44 std::cout <<
"Image size: " << I.getWidth() <<
" " << I.getHeight() << std::endl;
49 std::cout <<
"No image viewer is available..." << std::endl;
57 vpDisplay::display( I );
58 vpDisplay::displayText( I, 20, 20,
"A click to quit...", vpColor::red );
59 vpDisplay::flush( I );
60 if ( vpDisplay::getClick( I,
false ) )
64 catch ( vpException e )
66 std::cout <<
"Catch an exception: " << e << std::endl;