2019-06-05 18:19:08 +02:00
|
|
|
#pragma once
|
2016-03-09 07:03:17 +01:00
|
|
|
|
|
|
|
// QT includes
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
// Hyperion-Dispmanx includes
|
|
|
|
#include <grabber/FramebufferFrameGrabber.h>
|
|
|
|
|
|
|
|
class FramebufferWrapper : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-03-04 22:17:42 +01:00
|
|
|
FramebufferWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz);
|
2016-03-09 07:03:17 +01:00
|
|
|
|
|
|
|
const Image<ColorRgb> & getScreenshot();
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Starts the timed capturing of screenshots
|
|
|
|
///
|
|
|
|
void start();
|
|
|
|
|
|
|
|
void stop();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void sig_screenshot(const Image<ColorRgb> & screenshot);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
///
|
|
|
|
/// Performs a single screenshot capture and publishes the capture screenshot on the screenshot signal.
|
|
|
|
///
|
|
|
|
void capture();
|
|
|
|
|
|
|
|
private:
|
|
|
|
/// The QT timer to generate capture-publish events
|
|
|
|
QTimer _timer;
|
|
|
|
|
|
|
|
/// The grabber for creating screenshots
|
|
|
|
FramebufferFrameGrabber _grabber;
|
|
|
|
|
|
|
|
// image buffers
|
|
|
|
Image<ColorRgb> _screenshot;
|
|
|
|
|
|
|
|
};
|