2014-01-30 13:35:29 +01:00
|
|
|
|
|
|
|
// QT includes
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
// Hyperion-X11 includes
|
2014-11-21 21:24:33 +01:00
|
|
|
#include <grabber/X11Grabber.h>
|
2014-01-30 13:35:29 +01:00
|
|
|
|
|
|
|
class X11Wrapper : public QObject
|
|
|
|
{
|
2014-11-21 21:24:33 +01:00
|
|
|
Q_OBJECT
|
2014-01-30 13:35:29 +01:00
|
|
|
public:
|
2014-12-14 14:26:59 +01:00
|
|
|
X11Wrapper(int grabInterval, int cropLeft, int cropRight, int cropTop, int cropBottom, int horizontalPixelDecimation, int verticalPixelDecimation);
|
2014-01-30 13:35:29 +01:00
|
|
|
|
2014-11-21 21:24:33 +01:00
|
|
|
const Image<ColorRgb> & getScreenshot();
|
2014-01-30 13:35:29 +01:00
|
|
|
|
2014-11-21 21:24:33 +01:00
|
|
|
///
|
|
|
|
/// Starts the timed capturing of screenshots
|
|
|
|
///
|
|
|
|
void start();
|
2014-01-30 13:35:29 +01:00
|
|
|
|
2014-11-21 21:24:33 +01:00
|
|
|
void stop();
|
2014-01-30 13:35:29 +01:00
|
|
|
|
|
|
|
signals:
|
2014-11-21 21:24:33 +01:00
|
|
|
void sig_screenshot(const Image<ColorRgb> & screenshot);
|
2014-01-30 13:35:29 +01:00
|
|
|
|
|
|
|
private slots:
|
2014-11-21 21:24:33 +01:00
|
|
|
///
|
|
|
|
/// Performs a single screenshot capture and publishes the capture screenshot on the screenshot
|
|
|
|
/// signal.
|
|
|
|
///
|
|
|
|
void capture();
|
2014-01-30 13:35:29 +01:00
|
|
|
|
|
|
|
private:
|
2014-11-21 21:24:33 +01:00
|
|
|
/// The QT timer to generate capture-publish events
|
|
|
|
QTimer _timer;
|
2014-01-30 13:35:29 +01:00
|
|
|
|
2014-11-21 21:24:33 +01:00
|
|
|
/// The grabber for creating screenshots
|
|
|
|
X11Grabber _grabber;
|
2014-01-30 13:35:29 +01:00
|
|
|
};
|