showImage.cpp 866 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * @file showImage.cpp
  3. * @brief simple image viewer, a hello world program for NICE
  4. * @author Erik Rodner
  5. * @date 11/16/2011
  6. */
  7. #include "core/basics/Exception.h"
  8. using namespace NICE;
  9. using namespace std;
  10. #ifdef NICE_USELIB_QT
  11. #ifdef NICE_USELIB_GLUT
  12. #include "core/imagedisplay/ImageDisplay.h"
  13. /**
  14. simple image viewer
  15. */
  16. int main ( int argc, char **argv )
  17. {
  18. #ifndef WIN32
  19. std::set_terminate ( __gnu_cxx::__verbose_terminate_handler );
  20. #endif
  21. for ( int i = 1 ; i < argc ; i++ )
  22. {
  23. ColorImage img ( argv[i] );
  24. showImage ( img );
  25. }
  26. return 0;
  27. }
  28. #else
  29. #warning "showImage only works with GLUT"
  30. int main ( void ) {
  31. fthrow ( Exception, "Please install the GLUT development files..." );
  32. }
  33. #endif
  34. #else
  35. #warning "showImage only works with Qt"
  36. int main ( void ) {
  37. fthrow ( Exception, "Please install the Qt development files..." );
  38. }
  39. #endif