mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge branch 'HEAD' of https://github.com/tvdzwan/hyperion.git
This commit is contained in:
@@ -39,7 +39,7 @@ public slots:
|
||||
private:
|
||||
const int _updateInterval_ms;
|
||||
const int _timeout_ms;
|
||||
|
||||
const int _priority;
|
||||
|
||||
QTimer _timer;
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// stl includes
|
||||
#include <list>
|
||||
|
||||
// QT includes
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
@@ -14,13 +16,27 @@
|
||||
#include <hyperion/PriorityMuxer.h>
|
||||
|
||||
// Forward class declaration
|
||||
namespace hyperion { class ColorTransform; }
|
||||
|
||||
namespace hyperion {
|
||||
class HsvTransform;
|
||||
class ColorTransform;
|
||||
}
|
||||
|
||||
class Hyperion : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
typedef PriorityMuxer::InputInfo InputInfo;
|
||||
|
||||
enum Color
|
||||
{
|
||||
RED, GREEN, BLUE, INVALID
|
||||
};
|
||||
|
||||
enum Transform
|
||||
{
|
||||
SATURATION_GAIN, VALUE_GAIN, THRESHOLD, GAMMA, BLACKLEVEL, WHITELEVEL
|
||||
};
|
||||
|
||||
static LedString createLedString(const Json::Value& ledsConfig);
|
||||
|
||||
static Json::Value loadConfig(const std::string& configFile);
|
||||
@@ -32,7 +48,21 @@ public:
|
||||
|
||||
unsigned getLedCount() const;
|
||||
|
||||
void setValue(int priority, std::vector<RgbColor> &ledColors, const int timeout_ms);
|
||||
void setColor(int priority, RgbColor &ledColor, const int timeout_ms);
|
||||
|
||||
void setColors(int priority, std::vector<RgbColor> &ledColors, const int timeout_ms);
|
||||
|
||||
void setTransform(Transform transform, Color color, double value);
|
||||
|
||||
void clear(int priority);
|
||||
|
||||
void clearall();
|
||||
|
||||
double getTransform(Transform transform, Color color) const;
|
||||
|
||||
QList<int> getActivePriorities() const;
|
||||
|
||||
const InputInfo& getPriorityInfo(const int priority) const;
|
||||
|
||||
private slots:
|
||||
void update();
|
||||
@@ -40,15 +70,16 @@ private slots:
|
||||
private:
|
||||
void applyTransform(std::vector<RgbColor>& colors) const;
|
||||
|
||||
LedString mLedString;
|
||||
LedString _ledString;
|
||||
|
||||
PriorityMuxer mMuxer;
|
||||
PriorityMuxer _muxer;
|
||||
|
||||
hyperion::ColorTransform* mRedTransform;
|
||||
hyperion::ColorTransform* mGreenTransform;
|
||||
hyperion::ColorTransform* mBlueTransform;
|
||||
hyperion::HsvTransform * _hsvTransform;
|
||||
hyperion::ColorTransform * _redTransform;
|
||||
hyperion::ColorTransform * _greenTransform;
|
||||
hyperion::ColorTransform * _blueTransform;
|
||||
|
||||
LedDevice* mDevice;
|
||||
LedDevice* _device;
|
||||
|
||||
QTimer _timer;
|
||||
};
|
||||
|
@@ -8,8 +8,7 @@
|
||||
#include <hyperion/ImageProcessorFactory.h>
|
||||
|
||||
// Forward class declaration
|
||||
namespace hyperion { class ImageToLedsMap;
|
||||
class ColorTransform; }
|
||||
namespace hyperion { class ImageToLedsMap; }
|
||||
|
||||
/**
|
||||
* The ImageProcessor translates an RGB-image to RGB-values for the leds. The processing is
|
||||
|
@@ -26,7 +26,7 @@ public:
|
||||
std::vector<RgbColor> ledColors;
|
||||
};
|
||||
|
||||
PriorityMuxer();
|
||||
PriorityMuxer(int ledCount);
|
||||
|
||||
~PriorityMuxer();
|
||||
|
||||
@@ -47,9 +47,11 @@ public:
|
||||
void setCurrentTime(const int64_t& now);
|
||||
|
||||
private:
|
||||
int mCurrentPriority;
|
||||
int _currentPriority;
|
||||
|
||||
QMap<int, InputInfo> mActiveInputs;
|
||||
QMap<int, InputInfo> _activeInputs;
|
||||
|
||||
const static int MAX_PRIORITY = std::numeric_limits<int>::max();
|
||||
InputInfo _lowestPriorityInfo;
|
||||
|
||||
const static int LOWEST_PRIORITY = std::numeric_limits<int>::max();
|
||||
};
|
||||
|
Reference in New Issue
Block a user