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

@@ -1,18 +0,0 @@
#pragma once
// STL includes
#include <string>
// Utils includes
#include <utils/RgbChannelAdjustment.h>
class ColorCorrection
{
public:
/// Unique identifier for this color correction
std::string _id;
/// The RGB correction
RgbChannelAdjustment _rgbCorrection;
};

View File

@@ -52,6 +52,7 @@ protected:
virtual void kodiOff();
virtual void kodiPause();
void setColors(const std::vector<ColorRgb> &ledColors, const int timeout_ms);
std::string _grabberName;
/// Pointer to Hyperion for writing led values

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;

View File

@@ -11,6 +11,7 @@
// Utils includes
#include <utils/ColorRgb.h>
#include <utils/Components.h>
///
/// The PriorityMuxer handles the priority channels. Led values input is written to the priority map
@@ -32,6 +33,7 @@ public:
int64_t timeoutTime_ms;
/// The colors for each led of the channel
std::vector<ColorRgb> ledColors;
hyperion::Components componentId;
};
/// The lowest possible priority, which is used when no priority channels are active
@@ -89,7 +91,7 @@ public:
/// @param[in] ledColors The led colors of the priority channel
/// @param[in] timeoutTime_ms The absolute timeout time of the channel
///
void setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms=-1);
void setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms=-1, hyperion::Components component=hyperion::COMP_INVALID);
///
/// Clears the specified priority channel

View File

@@ -16,7 +16,9 @@ enum Components
COMP_UDPLISTENER,
COMP_BOBLIGHTSERVER,
COMP_GRABBER,
COMP_V4L
COMP_V4L,
COMP_COLOR,
COMP_EFFECT
};
inline const char* componentToString(Components c)
@@ -30,7 +32,9 @@ inline const char* componentToString(Components c)
case COMP_UDPLISTENER: return "UDP listener";
case COMP_BOBLIGHTSERVER:return "Boblight server";
case COMP_GRABBER: return "Framegrabber";
case COMP_V4L: return "V4l Capture device";
case COMP_V4L: return "V4L capture device";
case COMP_COLOR: return "solid color";
case COMP_EFFECT: return "effect";
default: return "";
}
}
@@ -47,6 +51,8 @@ inline const char* componentToIdString(Components c)
case COMP_BOBLIGHTSERVER:return "BOBLIGHTSERVER";
case COMP_GRABBER: return "GRABBER";
case COMP_V4L: return "V4L";
case COMP_COLOR: return "COLOR";
case COMP_EFFECT: return "EFFECT";
default: return "";
}
}
@@ -62,6 +68,8 @@ inline Components stringToComponent(QString component)
if (component == "BOBLIGHTSERVER")return COMP_BOBLIGHTSERVER;
if (component == "GRABBER") return COMP_GRABBER;
if (component == "V4L") return COMP_V4L;
if (component == "COLOR") return COMP_COLOR;
if (component == "EFFECT") return COMP_EFFECT;
return COMP_INVALID;
}