mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Implemented the multi-color transform including in hyperion-remote
Former-commit-id: ebdb0688b47d51bd6dccf6dafd580d3ce9ed80a7
This commit is contained in:
26
include/hyperion/ColorTransform.h
Normal file
26
include/hyperion/ColorTransform.h
Normal 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;
|
||||
};
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user