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

@@ -261,7 +261,7 @@ PyObject* Effect::wrapSetColor(PyObject *self, PyObject *args)
if (PyArg_ParseTuple(args, "bbb", &color.red, &color.green, &color.blue))
{
std::fill(effect->_colors.begin(), effect->_colors.end(), color);
effect->setColors(effect->_priority, effect->_colors, timeout, false);
effect->setColors(effect->_priority, effect->_colors, timeout, false, hyperion::COMP_EFFECT);
return Py_BuildValue("");
}
else
@@ -282,7 +282,7 @@ PyObject* Effect::wrapSetColor(PyObject *self, PyObject *args)
{
char * data = PyByteArray_AS_STRING(bytearray);
memcpy(effect->_colors.data(), data, length);
effect->setColors(effect->_priority, effect->_colors, timeout, false);
effect->setColors(effect->_priority, effect->_colors, timeout, false, hyperion::COMP_EFFECT);
return Py_BuildValue("");
}
else
@@ -352,7 +352,7 @@ PyObject* Effect::wrapSetImage(PyObject *self, PyObject *args)
memcpy(image.memptr(), data, length);
effect->_imageProcessor->process(image, effect->_colors);
effect->setColors(effect->_priority, effect->_colors, timeout, false);
effect->setColors(effect->_priority, effect->_colors, timeout, false, hyperion::COMP_EFFECT);
return Py_BuildValue("");
}
else
@@ -428,7 +428,7 @@ PyObject* Effect::wrapImageShow(PyObject *self, PyObject *args)
memcpy(image.memptr(), binaryImage.data(), binaryImage.size());
effect->_imageProcessor->process(image, effect->_colors);
effect->setColors(effect->_priority, effect->_colors, timeout, false);
effect->setColors(effect->_priority, effect->_colors, timeout, false, hyperion::COMP_EFFECT);
return Py_BuildValue("");
}

View File

@@ -11,6 +11,7 @@
// Hyperion includes
#include <hyperion/ImageProcessor.h>
#include <utils/Components.h>
class Effect : public QThread
{
@@ -42,7 +43,7 @@ public slots:
signals:
void effectFinished(Effect * effect);
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects);
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects, hyperion::Components component);
private slots:
void effectFinished();

View File

@@ -13,6 +13,7 @@
// hyperion util includes
#include <utils/jsonschema/QJsonSchemaChecker.h>
#include <utils/FileUtils.h>
#include <utils/Components.h>
// effect engine includes
#include <effectengine/EffectEngine.h>
@@ -28,6 +29,7 @@ EffectEngine::EffectEngine(Hyperion * hyperion, const QJsonObject & jsonEffectCo
{
Q_INIT_RESOURCE(EffectEngine);
qRegisterMetaType<std::vector<ColorRgb>>("std::vector<ColorRgb>");
qRegisterMetaType<hyperion::Components>("hyperion::Components");
// connect the Hyperion channel clear feedback
connect(_hyperion, SIGNAL(channelCleared(int)), this, SLOT(channelCleared(int)));
@@ -272,7 +274,7 @@ int EffectEngine::runEffectScript(const QString &script, const QString &name, co
// create the effect
Effect * effect = new Effect(_mainThreadState, priority, timeout, script, name, args);
connect(effect, SIGNAL(setColors(int,std::vector<ColorRgb>,int,bool)), _hyperion, SLOT(setColors(int,std::vector<ColorRgb>,int,bool)), Qt::QueuedConnection);
connect(effect, SIGNAL(setColors(int,std::vector<ColorRgb>,int,bool,hyperion::Components)), _hyperion, SLOT(setColors(int,std::vector<ColorRgb>,int,bool,hyperion::Components)), Qt::QueuedConnection);
connect(effect, SIGNAL(effectFinished(Effect*)), this, SLOT(effectFinished(Effect*)));
_activeEffects.push_back(effect);