showImage.cpp 958 B

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