2016-02-24 16:03:21 +01:00
|
|
|
|
|
|
|
// Hyperion-AmLogic includes
|
|
|
|
#include "AmlogicWrapper.h"
|
|
|
|
|
2019-02-08 09:38:31 +01:00
|
|
|
AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const unsigned ge2d_mode, const QString device) :
|
2016-05-26 23:44:27 +02:00
|
|
|
_timer(this),
|
2019-02-08 09:38:31 +01:00
|
|
|
_grabber(grabWidth, grabHeight, ge2d_mode, device)
|
2016-02-24 16:03:21 +01:00
|
|
|
{
|
2016-05-26 23:44:27 +02:00
|
|
|
_timer.setSingleShot(false);
|
|
|
|
_timer.setInterval(updateRate_Hz);
|
2016-02-24 16:03:21 +01:00
|
|
|
|
2016-05-26 23:44:27 +02:00
|
|
|
// Connect capturing to the timeout signal of the timer
|
|
|
|
connect(&_timer, SIGNAL(timeout()), this, SLOT(capture()));
|
2016-02-24 16:03:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const Image<ColorRgb> & AmlogicWrapper::getScreenshot()
|
|
|
|
{
|
|
|
|
capture();
|
2017-08-12 07:55:32 +02:00
|
|
|
return _screenshot;
|
2016-02-24 16:03:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void AmlogicWrapper::start()
|
|
|
|
{
|
2016-05-26 23:44:27 +02:00
|
|
|
_timer.start();
|
2016-02-24 16:03:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void AmlogicWrapper::stop()
|
|
|
|
{
|
2016-05-26 23:44:27 +02:00
|
|
|
_timer.stop();
|
2016-02-24 16:03:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void AmlogicWrapper::capture()
|
|
|
|
{
|
|
|
|
_grabber.grabFrame(_screenshot);
|
2017-08-12 07:55:32 +02:00
|
|
|
emit sig_screenshot(_screenshot);
|
2016-02-24 16:03:21 +01:00
|
|
|
}
|