2016-02-24 14:34:19 +01:00
|
|
|
|
|
|
|
// QT includes
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
// Hyperion-Dispmanx includes
|
|
|
|
#include <grabber/DispmanxFrameGrabber.h>
|
|
|
|
|
|
|
|
class DispmanxWrapper : public QObject
|
|
|
|
{
|
2016-02-24 16:03:21 +01:00
|
|
|
Q_OBJECT
|
2016-02-24 14:34:19 +01:00
|
|
|
public:
|
2016-05-18 11:26:25 +02:00
|
|
|
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight,
|
|
|
|
const VideoMode& videoMode,
|
|
|
|
const unsigned cropLeft, const unsigned cropRight,
|
|
|
|
const unsigned cropTop, const unsigned cropBottom,
|
|
|
|
const unsigned updateRate_Hz);
|
2016-02-24 14:34:19 +01:00
|
|
|
|
2016-02-24 16:03:21 +01:00
|
|
|
const Image<ColorRgb> & getScreenshot();
|
2016-02-24 14:34:19 +01:00
|
|
|
|
2016-02-24 16:03:21 +01:00
|
|
|
///
|
|
|
|
/// Starts the timed capturing of screenshots
|
|
|
|
///
|
|
|
|
void start();
|
2016-02-24 14:34:19 +01:00
|
|
|
|
2016-02-24 16:03:21 +01:00
|
|
|
void stop();
|
2016-02-24 14:34:19 +01:00
|
|
|
|
|
|
|
signals:
|
2016-02-24 16:03:21 +01:00
|
|
|
void sig_screenshot(const Image<ColorRgb> & screenshot);
|
2016-02-24 14:34:19 +01:00
|
|
|
|
|
|
|
private slots:
|
2016-02-24 16:03:21 +01:00
|
|
|
///
|
|
|
|
/// Performs a single screenshot capture and publishes the capture screenshot on the screenshot
|
|
|
|
/// signal.
|
|
|
|
///
|
|
|
|
void capture();
|
2016-02-24 14:34:19 +01:00
|
|
|
|
|
|
|
private:
|
2016-02-24 16:03:21 +01:00
|
|
|
/// The QT timer to generate capture-publish events
|
|
|
|
QTimer _timer;
|
2016-02-24 14:34:19 +01:00
|
|
|
|
2016-02-24 16:03:21 +01:00
|
|
|
/// The grabber for creating screenshots
|
|
|
|
DispmanxFrameGrabber _grabber;
|
2017-08-12 07:55:32 +02:00
|
|
|
Image<ColorRgb> _screenshot;
|
2016-02-24 14:34:19 +01:00
|
|
|
};
|