ImageDisplaySDL.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _IMAGEDISPLAY_SDLWIDGET_H
  2. #define _IMAGEDISPLAY_SDLWIDGET_H
  3. //#include <boost/utility.hpp>
  4. #include <qwidget.h>
  5. #include <core/image/ColorImageT.h>
  6. #include <core/image/ImageT.h>
  7. #include <core/basics/NonCopyable.h>
  8. #include <memory>
  9. struct SDL_Surface;
  10. namespace NICE {
  11. /**
  12. * High performance video display using SDL.
  13. *
  14. * @note This class is experimental!
  15. *
  16. * @note
  17. * There must not be more than one instance of ImageDisplaySDL.
  18. * Additional instances will not display anything.
  19. *
  20. * @note
  21. * This class is currently NOT thread safe!
  22. *
  23. * @note
  24. * This class is HIGHLY experimental and might change in the future.
  25. *
  26. * @author Ferid Bajramovic
  27. */
  28. class ImageDisplaySDL : public QWidget, private NICE::NonCopyable {
  29. Q_OBJECT
  30. public:
  31. ImageDisplaySDL(QWidget* parent = NULL, const char* name = NULL);
  32. virtual ~ImageDisplaySDL();
  33. void setImage(ColorImage* image, const bool copy = false);
  34. protected:
  35. void resizeEvent(QResizeEvent *);
  36. void paintEvent(QPaintEvent *);
  37. private:
  38. SDL_Surface* screen;
  39. NICE::ColorImage* colorImage;
  40. static bool sdlDisplayActive;
  41. };
  42. } // namespace
  43. #endif // _IMAGEDISPLAY_SDLWIDGET_H