mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Changed the image-to-leds map by using offset-pointing.
Moved the image-buffer from processor to dispmanx-wrapper. Added timeout handling to Hyperion.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
// Utils includes
|
||||
#include <utils/RgbColor.h>
|
||||
#include <utils/RgbImage.h>
|
||||
|
||||
// Forward class declaration
|
||||
class DispmanxFrameGrabber;
|
||||
@@ -42,6 +43,7 @@ private:
|
||||
|
||||
QTimer _timer;
|
||||
|
||||
RgbImage _image;
|
||||
DispmanxFrameGrabber * _frameGrabber;
|
||||
ImageProcessor * _processor;
|
||||
|
||||
|
@@ -1,6 +1,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// QT includes
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
// hyperion-utils includes
|
||||
#include <utils/RgbImage.h>
|
||||
|
||||
@@ -13,8 +17,9 @@
|
||||
namespace hyperion { class ColorTransform; }
|
||||
|
||||
|
||||
class Hyperion
|
||||
class Hyperion : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Hyperion(const Json::Value& jsonConfig);
|
||||
|
||||
@@ -24,6 +29,9 @@ public:
|
||||
|
||||
void setValue(int priority, std::vector<RgbColor> &ledColors, const int timeout_ms);
|
||||
|
||||
private slots:
|
||||
void update();
|
||||
|
||||
private:
|
||||
void applyTransform(std::vector<RgbColor>& colors) const;
|
||||
|
||||
@@ -36,4 +44,6 @@ private:
|
||||
hyperion::ColorTransform* mBlueTransform;
|
||||
|
||||
LedDevice* mDevice;
|
||||
|
||||
QTimer _timer;
|
||||
};
|
||||
|
@@ -21,18 +21,6 @@ class ImageProcessor
|
||||
public:
|
||||
~ImageProcessor();
|
||||
|
||||
/**
|
||||
* Processes the image to a list of led colors. This will update the size of the buffer-image
|
||||
* if required and call the image-to-leds mapping to determine the mean color per led.
|
||||
*
|
||||
* @param[in] image The image to translate to led values
|
||||
*
|
||||
* @return The color value per led
|
||||
*/
|
||||
std::vector<RgbColor> process(const RgbImage& image);
|
||||
|
||||
// 'IN PLACE' processing functions
|
||||
|
||||
/**
|
||||
* Specifies the width and height of 'incomming' images. This will resize the buffer-image to
|
||||
* match the given size.
|
||||
@@ -44,19 +32,21 @@ public:
|
||||
void setSize(const unsigned width, const unsigned height);
|
||||
|
||||
/**
|
||||
* Returns a reference of the underlying image-buffer. This can be used to write data directly
|
||||
* into the buffer, avoiding a copy inside the process method.
|
||||
* Processes the image to a list of led colors. This will update the size of the buffer-image
|
||||
* if required and call the image-to-leds mapping to determine the mean color per led.
|
||||
*
|
||||
* @return The reference of the underlying image-buffer.
|
||||
* @param[in] image The image to translate to led values
|
||||
*
|
||||
* @return The color value per led
|
||||
*/
|
||||
RgbImage& image();
|
||||
std::vector<RgbColor> process(const RgbImage& image);
|
||||
|
||||
/**
|
||||
* Determines the led colors of the image in the buffer.
|
||||
*
|
||||
* @param[out] ledColors The color value per led
|
||||
*/
|
||||
void inplace_process(std::vector<RgbColor>& ledColors);
|
||||
void process(const RgbImage& image, std::vector<RgbColor>& ledColors);
|
||||
|
||||
private:
|
||||
friend class ImageProcessorFactory;
|
||||
@@ -66,7 +56,6 @@ private:
|
||||
private:
|
||||
const LedString mLedString;
|
||||
|
||||
RgbImage *mBuffer;
|
||||
hyperion::ImageToLedsMap* mImageToLeds;
|
||||
};
|
||||
|
||||
|
@@ -18,9 +18,9 @@ namespace Json { class Value; }
|
||||
* <pre>
|
||||
* |--------------------image--|
|
||||
* | minX maxX |
|
||||
* | |-----|maxY |
|
||||
* | | | |
|
||||
* | |-----|minY |
|
||||
* | | | |
|
||||
* | |-----|maxY |
|
||||
* | |
|
||||
* | |
|
||||
* | |
|
||||
|
Reference in New Issue
Block a user