Created first draft of 'hyperion-d'.

This commit is contained in:
T. van der Zwan
2013-08-14 08:54:49 +00:00
parent b411b166ae
commit 7bdd10859e
6 changed files with 77 additions and 25 deletions

View File

@@ -4,18 +4,30 @@
#include <QObject>
#include <QTimer>
// Forward class declaration
class ImageProcessor;
class DispmanxFrameGrabber;
// Utils includes
#include <utils/RgbColor.h>
// Forward class declaration
class DispmanxFrameGrabber;
class Hyperion;
class ImageProcessor;
///
/// The DispmanxWrapper uses an instance of the DispmanxFrameGrabber to obtain RgbImage's from the
/// displayed content. This RgbImage is processed to a RgbColor for each led and commmited to the
/// attached Hyperion.
///
class DispmanxWrapper: public QObject
{
Q_OBJECT
public:
DispmanxWrapper();
DispmanxWrapper(const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, Hyperion * hyperion);
virtual ~DispmanxWrapper();
signals:
void ledValues(const unsigned priority, const std::vector<RgbColor> ledColors, const unsigned timeout_ms);
public slots:
void start();
@@ -24,9 +36,17 @@ public slots:
void stop();
private:
const int _updateInterval_ms;
const int _timeout_ms;
QTimer _timer;
DispmanxFrameGrabber* _frameGrabber;
ImageProcessor* _processor;
DispmanxFrameGrabber * _frameGrabber;
ImageProcessor * _processor;
std::vector<RgbColor> _ledColors;
Hyperion * _hyperion;
};

View File

@@ -20,7 +20,9 @@ public:
~Hyperion();
void setValue(int priority, std::vector<RgbColor> &ledColors);
unsigned getLedCount() const;
void setValue(int priority, std::vector<RgbColor> &ledColors, const int timeout_ms);
private:
void applyTransform(std::vector<RgbColor>& colors) const;