Implemented the multi-color transform including in hyperion-remote

Former-commit-id: ebdb0688b47d51bd6dccf6dafd580d3ce9ed80a7
This commit is contained in:
T. van der Zwan
2013-11-22 10:48:10 +00:00
parent 958feabf5b
commit 826b964bf6
12 changed files with 357 additions and 330 deletions

View File

@@ -0,0 +1,26 @@
#pragma once
// STL includes
#include <string>
// Utils includes
#include <utils/RgbChannelTransform.h>
#include <utils/HsvTransform.h>
class ColorTransform
{
public:
/// Unique identifier for this color transform
std::string _id;
/// The RED-Channel (RGB) transform
RgbChannelTransform _rgbRedTransform;
/// The GREEN-Channel (RGB) transform
RgbChannelTransform _rgbGreenTransform;
/// The BLUE-Channel (RGB) transform
RgbChannelTransform _rgbBlueTransform;
/// The HSV Transform for applying Saturation and Value transforms
HsvTransform _hsvTransform;
};

View File

@@ -16,6 +16,7 @@
#include <hyperion/PriorityMuxer.h>
// Forward class declaration
class ColorTransform;
class HsvTransform;
class RgbChannelTransform;
class MultiColorTransform;
@@ -89,15 +90,16 @@ public:
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms);
///
/// Sets/Updates a part of the color transformation.
/// Returns the list with unique transform identifiers
/// @return The list with transform identifiers
///
/// @param[in] transform The type of transform to configure
/// @param[in] color The color channel to which the transform applies (only applicable for
/// Transform::THRESHOLD, Transform::GAMMA, Transform::BLACKLEVEL,
/// Transform::WHITELEVEL)
/// @param[in] value The new value for the given transform
const std::vector<std::string> & getTransformIds() const;
///
void setTransform(Transform transform, RgbChannel color, double value);
/// Returns the ColorTransform with the given identifier
/// @return The transform with the given identifier (or nullptr if the identifier does not exist)
///
ColorTransform * getTransform(const std::string& id);
///
/// Clears the given priority channel. This will switch the led-colors to the colors of the next
@@ -112,18 +114,6 @@ public:
///
void clearall();
///
/// Returns the value of a specific color transform
///
/// @param[in] transform The type of transform
/// @param[in] color The color channel to which the transform applies (only applicable for
/// Transform::THRESHOLD, Transform::GAMMA, Transform::BLACKLEVEL,
/// Transform::WHITELEVEL)
///
/// @return The value of the specified color transform
///
double getTransform(Transform transform, RgbChannel color) const;
///
/// Returns a list of active priorities
///
@@ -147,8 +137,9 @@ public:
static LedString createLedString(const Json::Value & ledsConfig);
static MultiColorTransform * createLedColorsTransform(const unsigned ledCnt, const Json::Value & colorTransformConfig);
static ColorTransform * createColorTransform(const Json::Value & transformConfig);
static HsvTransform * createHsvTransform(const Json::Value & hsvConfig);
static RgbChannelTransform * createColorTransform(const Json::Value& colorConfig);
static RgbChannelTransform * createRgbChannelTransform(const Json::Value& colorConfig);
static LedDevice * createColorSmoothing(const Json::Value & smoothingConfig, LedDevice * ledDevice);