mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
* fix/refactor backlight stuff: - fix colors dont turn of when backlight 0 and black is set - add option to use not colored backlight - fix colored backlight not colored on very low color values - various code style tunings * apply needed change to wizard * backlight disabled on static color and efects * fix warnings * try fix udp compiler warnings
70 lines
1.8 KiB
C++
70 lines
1.8 KiB
C++
#pragma once
|
|
|
|
// STL includes
|
|
#include <vector>
|
|
|
|
// Utils includes
|
|
#include <utils/ColorRgb.h>
|
|
|
|
// Hyperion includes
|
|
#include <hyperion/ColorAdjustment.h>
|
|
|
|
///
|
|
/// The LedColorTransform is responsible for performing color transformation from 'raw' colors
|
|
/// received as input to colors mapped to match the color-properties of the leds.
|
|
///
|
|
class MultiColorAdjustment
|
|
{
|
|
public:
|
|
MultiColorAdjustment(const unsigned ledCnt);
|
|
~MultiColorAdjustment();
|
|
|
|
/**
|
|
* Adds a new ColorAdjustment to this MultiColorTransform
|
|
*
|
|
* @param adjustment The new ColorAdjustment (ownership is transfered)
|
|
*/
|
|
void addAdjustment(ColorAdjustment * adjustment);
|
|
|
|
void setAdjustmentForLed(const std::string& id, const unsigned startLed, const unsigned endLed);
|
|
|
|
bool verifyAdjustments() const;
|
|
|
|
void setBacklightEnabled(bool enable);
|
|
|
|
///
|
|
/// Returns the identifier of all the unique ColorAdjustment
|
|
///
|
|
/// @return The list with unique id's of the ColorAdjustment
|
|
const std::vector<std::string> & getAdjustmentIds();
|
|
|
|
///
|
|
/// Returns the pointer to the ColorAdjustment with the given id
|
|
///
|
|
/// @param id The identifier of the ColorAdjustment
|
|
///
|
|
/// @return The ColorAdjustment with the given id (or nullptr if it does not exist)
|
|
///
|
|
ColorAdjustment* getAdjustment(const std::string& id);
|
|
|
|
///
|
|
/// Performs the color adjustment from raw-color to led-color
|
|
///
|
|
/// @param ledColors The list with raw colors
|
|
///
|
|
void applyAdjustment(std::vector<ColorRgb>& ledColors);
|
|
|
|
private:
|
|
/// List with transform ids
|
|
std::vector<std::string> _adjustmentIds;
|
|
|
|
/// List with unique ColorTransforms
|
|
std::vector<ColorAdjustment*> _adjustment;
|
|
|
|
/// List with a pointer to the ColorAdjustment for each individual led
|
|
std::vector<ColorAdjustment*> _ledAdjustments;
|
|
|
|
// logger instance
|
|
Logger * _log;
|
|
};
|