2016-04-02 00:04:11 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// STL includes
|
|
|
|
#include <vector>
|
2017-03-04 22:17:42 +01:00
|
|
|
#include <QStringList>
|
|
|
|
#include <QString>
|
2016-04-02 00:04:11 +02:00
|
|
|
|
|
|
|
// Hyperion includes
|
2017-03-04 22:17:42 +01:00
|
|
|
#include <utils/ColorRgb.h>
|
2016-04-02 00:04:11 +02:00
|
|
|
#include <hyperion/ColorAdjustment.h>
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The LedColorTransform is responsible for performing color transformation from 'raw' colors
|
2020-11-14 17:58:56 +01:00
|
|
|
/// received as input to colors mapped to match the color-properties of the LEDs.
|
2016-04-02 00:04:11 +02:00
|
|
|
///
|
|
|
|
class MultiColorAdjustment
|
|
|
|
{
|
|
|
|
public:
|
2020-11-14 17:58:56 +01:00
|
|
|
MultiColorAdjustment(int ledCnt);
|
2016-04-02 00:04:11 +02:00
|
|
|
~MultiColorAdjustment();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a new ColorAdjustment to this MultiColorTransform
|
|
|
|
*
|
2020-11-14 17:58:56 +01:00
|
|
|
* @param adjustment The new ColorAdjustment (ownership is transferred)
|
2016-04-02 00:04:11 +02:00
|
|
|
*/
|
|
|
|
void addAdjustment(ColorAdjustment * adjustment);
|
|
|
|
|
2020-11-14 17:58:56 +01:00
|
|
|
void setAdjustmentForLed(const QString& id, int startLed, int endLed);
|
2016-04-02 00:04:11 +02:00
|
|
|
|
|
|
|
bool verifyAdjustments() const;
|
|
|
|
|
2017-02-11 22:52:47 +01:00
|
|
|
void setBacklightEnabled(bool enable);
|
|
|
|
|
2016-04-02 00:04:11 +02:00
|
|
|
///
|
|
|
|
/// Returns the identifier of all the unique ColorAdjustment
|
|
|
|
///
|
|
|
|
/// @return The list with unique id's of the ColorAdjustment
|
2020-08-08 23:12:43 +02:00
|
|
|
QStringList getAdjustmentIds() const;
|
2016-04-02 00:04:11 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// 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)
|
|
|
|
///
|
2017-03-04 22:17:42 +01:00
|
|
|
ColorAdjustment* getAdjustment(const QString& id);
|
2016-04-02 00:04:11 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// Performs the color adjustment from raw-color to led-color
|
|
|
|
///
|
2016-07-01 23:20:41 +02:00
|
|
|
/// @param ledColors The list with raw colors
|
2016-04-02 00:04:11 +02:00
|
|
|
///
|
2016-07-01 23:20:41 +02:00
|
|
|
void applyAdjustment(std::vector<ColorRgb>& ledColors);
|
2016-04-02 00:04:11 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// List with transform ids
|
2017-03-04 22:17:42 +01:00
|
|
|
QStringList _adjustmentIds;
|
2016-04-02 00:04:11 +02:00
|
|
|
|
|
|
|
/// List with unique ColorTransforms
|
|
|
|
std::vector<ColorAdjustment*> _adjustment;
|
|
|
|
|
|
|
|
/// List with a pointer to the ColorAdjustment for each individual led
|
|
|
|
std::vector<ColorAdjustment*> _ledAdjustments;
|
2017-01-10 19:58:41 +01:00
|
|
|
|
|
|
|
// logger instance
|
|
|
|
Logger * _log;
|
2016-04-02 00:04:11 +02:00
|
|
|
};
|