2020-08-08 12:59:40 +02:00
|
|
|
#pragma once
|
2019-01-06 19:49:56 +01:00
|
|
|
|
|
|
|
// QT includes
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
// Hyperion-Qt includes
|
|
|
|
#include <grabber/QtGrabber.h>
|
|
|
|
|
|
|
|
//Utils includes
|
|
|
|
#include <utils/VideoMode.h>
|
|
|
|
|
|
|
|
class QtWrapper : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QtWrapper(int grabInterval, int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, int display);
|
|
|
|
|
|
|
|
const Image<ColorRgb> & getScreenshot();
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Starts the timed capturing of screenshots
|
|
|
|
///
|
|
|
|
void start();
|
|
|
|
|
|
|
|
void stop();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void sig_screenshot(const Image<ColorRgb> & screenshot);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
///
|
|
|
|
/// Set the video mode (2D/3D)
|
|
|
|
/// @param[in] mode The new video mode
|
|
|
|
///
|
2020-08-08 13:09:15 +02:00
|
|
|
void setVideoMode(VideoMode videoMode);
|
2019-01-06 19:49:56 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
QtGrabber _grabber;
|
|
|
|
|
|
|
|
Image<ColorRgb> _screenshot;
|
|
|
|
};
|