implement optional color correction for V4L only (#267)

* remove color temperatire, its the same as color adjustment

* remove temperature from schema

* implement most part of v4l only colro settings,
now hyperion update knows from which component the colors come

* update configs

* fix webui config write

* reomve correction and temperature from hyperion-remote
This commit is contained in:
redPanther
2016-10-10 18:29:54 +02:00
committed by GitHub
parent d9c2a2d91a
commit e889996ae7
31 changed files with 107 additions and 638 deletions

View File

@@ -22,7 +22,6 @@
#include <hyperion/LedString.h>
#include <hyperion/PriorityMuxer.h>
#include <hyperion/ColorTransform.h>
#include <hyperion/ColorCorrection.h>
#include <hyperion/ColorAdjustment.h>
#include <hyperion/MessageForwarder.h>
#include <hyperion/ComponentRegister.h>
@@ -42,10 +41,8 @@ class EffectEngine;
class HsvTransform;
class HslTransform;
class RgbChannelTransform;
class RgbChannelCorrection;
class RgbChannelAdjustment;
class MultiColorTransform;
class MultiColorCorrection;
class MultiColorAdjustment;
class KODIVideoChecker;
///
@@ -189,20 +186,14 @@ public slots:
/// @param[in] ledColors The colors to write to the leds
/// @param[in] timeout_ms The time the leds are set to the given colors [ms]
///
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects = true);
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects = true, hyperion::Components component=hyperion::COMP_INVALID);
///
/// Returns the list with unique transform identifiers
/// @return The list with transform identifiers
///
const std::vector<std::string> & getTransformIds() const;
///
/// Returns the list with unique correction identifiers
/// @return The list with correction identifiers
///
const std::vector<std::string> & getTemperatureIds() const;
///
/// Returns the list with unique adjustment identifiers
/// @return The list with adjustment identifiers
@@ -214,19 +205,13 @@ public slots:
/// @return The transform with the given identifier (or nullptr if the identifier does not exist)
///
ColorTransform * getTransform(const std::string& id);
///
/// Returns the ColorCorrection with the given identifier
/// @return The correction with the given identifier (or nullptr if the identifier does not exist)
///
ColorCorrection * getTemperature(const std::string& id);
///
/// Returns the ColorAdjustment with the given identifier
/// @return The adjustment with the given identifier (or nullptr if the identifier does not exist)
///
ColorAdjustment * getAdjustment(const std::string& id);
///
/// Returns MessageForwarder Object
/// @return instance of message forwarder object
@@ -235,12 +220,6 @@ public slots:
/// Tell Hyperion that the transforms have changed and the leds need to be updated
void transformsUpdated();
/// Tell Hyperion that the corrections have changed and the leds need to be updated
void correctionsUpdated();
/// Tell Hyperion that the corrections have changed and the leds need to be updated
void temperaturesUpdated();
/// Tell Hyperion that the corrections have changed and the leds need to be updated
void adjustmentsUpdated();
@@ -286,10 +265,8 @@ public:
static LedString createLedStringClone(const QJsonValue & ledsConfig, const ColorOrder deviceOrder);
static MultiColorTransform * createLedColorsTransform(const unsigned ledCnt, const QJsonObject & colorTransformConfig);
static MultiColorCorrection * createLedColorsTemperature(const unsigned ledCnt, const QJsonObject & colorTemperatureConfig);
static MultiColorAdjustment * createLedColorsAdjustment(const unsigned ledCnt, const QJsonObject & colorAdjustmentConfig);
static ColorTransform * createColorTransform(const QJsonObject & transformConfig);
static ColorCorrection * createColorCorrection(const QJsonObject & correctionConfig);
static ColorAdjustment * createColorAdjustment(const QJsonObject & adjustmentConfig);
static HsvTransform * createHsvTransform(const QJsonObject & hsvConfig);
static HslTransform * createHslTransform(const QJsonObject & hslConfig);
@@ -340,10 +317,7 @@ private:
/// The transformation from raw colors to led colors
MultiColorTransform * _raw2ledTransform;
/// The temperature from raw colors to led colors
MultiColorCorrection * _raw2ledTemperature;
/// The adjustment from raw colors to led colors
MultiColorAdjustment * _raw2ledAdjustment;
@@ -383,15 +357,18 @@ private:
/// register of input sources and it's prio channel
PriorityRegister _priorityRegister;
/// flag for v4l color correction
bool _colorAdjustmentV4Lonly;
/// flag for v4l color correction
bool _colorTransformV4Lonly;
/// flag for color transform enable
bool _transformEnabled;
/// flag for color adjustment enable
bool _adjustmentEnabled;
/// flag for color temperature enable
bool _temperatureEnabled;
/// flag indicates state for autoselection of input source
bool _sourceAutoSelectEnabled;