showImage.cpp 845 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. std::set_terminate ( __gnu_cxx::__verbose_terminate_handler );
  19. for ( int i = 1 ; i < argc ; i++ )
  20. {
  21. ColorImage img ( argv[i] );
  22. showImage ( img );
  23. }
  24. return 0;
  25. }
  26. #else
  27. #warning "showImage only works with GLUT"
  28. int main ( void ) {
  29. fthrow ( Exception, "Please install the GLUT development files..." );
  30. }
  31. #endif
  32. #else
  33. #warning "showImage only works with Qt"
  34. int main ( void ) {
  35. fthrow ( Exception, "Please install the Qt development files..." );
  36. }
  37. #endif