2015-12-22 10:08:31 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// STL includes
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
// Utils includes
|
|
|
|
#include <utils/ColorRgb.h>
|
|
|
|
|
|
|
|
// Hyperion includes
|
|
|
|
#include <hyperion/ColorCorrection.h>
|
|
|
|
|
|
|
|
///
|
2015-12-22 10:12:34 +01:00
|
|
|
/// The LedColorCorrection is responsible for performing color correction from 'raw' colors
|
2015-12-22 10:08:31 +01:00
|
|
|
/// received as input to colors mapped to match the color-properties of the leds.
|
|
|
|
///
|
|
|
|
class MultiColorCorrection
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MultiColorCorrection(const unsigned ledCnt);
|
|
|
|
~MultiColorCorrection();
|
|
|
|
|
|
|
|
/**
|
2015-12-22 10:12:34 +01:00
|
|
|
* Adds a new ColorCorrection to this MultiColorCorrection
|
2015-12-22 10:08:31 +01:00
|
|
|
*
|
2015-12-22 10:12:34 +01:00
|
|
|
* @param Correction The new ColorCorrection (ownership is transfered)
|
2015-12-22 10:08:31 +01:00
|
|
|
*/
|
|
|
|
void addCorrection(ColorCorrection * correction);
|
|
|
|
|
|
|
|
void setCorrectionForLed(const std::string& id, const unsigned startLed, const unsigned endLed);
|
|
|
|
|
|
|
|
bool verifyCorrections() const;
|
|
|
|
|
|
|
|
///
|
2015-12-22 10:12:34 +01:00
|
|
|
/// Returns the identifier of all the unique ColorCorrection
|
2015-12-22 10:08:31 +01:00
|
|
|
///
|
2015-12-22 10:12:34 +01:00
|
|
|
/// @return The list with unique id's of the ColorCorrections
|
2015-12-22 10:08:31 +01:00
|
|
|
const std::vector<std::string> & getCorrectionIds();
|
|
|
|
|
|
|
|
///
|
2015-12-22 10:12:34 +01:00
|
|
|
/// Returns the pointer to the ColorCorrection with the given id
|
2015-12-22 10:08:31 +01:00
|
|
|
///
|
2015-12-22 10:12:34 +01:00
|
|
|
/// @param id The identifier of the ColorCorrection
|
2015-12-22 10:08:31 +01:00
|
|
|
///
|
2015-12-22 10:12:34 +01:00
|
|
|
/// @return The ColorCorrection with the given id (or nullptr if it does not exist)
|
2015-12-22 10:08:31 +01:00
|
|
|
///
|
|
|
|
ColorCorrection* getCorrection(const std::string& id);
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Performs the color transoformation from raw-color to led-color
|
|
|
|
///
|
|
|
|
/// @param rawColors The list with raw colors
|
|
|
|
///
|
|
|
|
/// @return The list with led-colors
|
|
|
|
///
|
|
|
|
std::vector<ColorRgb> applyCorrection(const std::vector<ColorRgb>& rawColors);
|
|
|
|
|
|
|
|
private:
|
2015-12-22 10:12:34 +01:00
|
|
|
/// List with Correction ids
|
2015-12-22 10:08:31 +01:00
|
|
|
std::vector<std::string> _correctionIds;
|
|
|
|
|
2015-12-22 10:12:34 +01:00
|
|
|
/// List with unique ColorCorrections
|
2015-12-22 10:08:31 +01:00
|
|
|
std::vector<ColorCorrection*> _correction;
|
|
|
|
|
2015-12-22 10:12:34 +01:00
|
|
|
/// List with a pointer to the ColorCorrection for each individual led
|
2015-12-22 10:08:31 +01:00
|
|
|
std::vector<ColorCorrection*> _ledCorrections;
|
|
|
|
};
|