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

@@ -377,64 +377,6 @@ void JsonConnection::setTransform(const QString &transformId,
parseReply(reply);
}
void JsonConnection::setCorrection(QString &correctionId, const QColor & correction)
{
std::cout << "Set color corrections" << std::endl;
// create command
Json::Value command;
command["command"] = "correction";
Json::Value & correct = command["correction"];
if (!correctionId.isNull())
{
correct["id"] = correctionId.toStdString();
}
if (correction.isValid())
{
Json::Value & v = correct["correctionValues"];
v.append(correction.red());
v.append(correction.green());
v.append(correction.blue());
}
// send command message
Json::Value reply = sendMessage(command);
// parse reply message
parseReply(reply);
}
void JsonConnection::setTemperature(const QString &temperatureId, const QColor & temperature)
{
std::cout << "Set color temperature corrections" << std::endl;
// create command
Json::Value command;
command["command"] = "temperature";
Json::Value & temp = command["temperature"];
if (!temperatureId.isNull())
{
temp["id"] = temperatureId.toStdString();
}
if (temperature.isValid())
{
Json::Value & v = temp["correctionValues"];
v.append(temperature.red());
v.append(temperature.green());
v.append(temperature.blue());
}
// send command message
Json::Value reply = sendMessage(command);
// parse reply message
parseReply(reply);
}
void JsonConnection::setAdjustment(const QString &adjustmentId,
const QColor & redAdjustment,
const QColor & greenAdjustment,

View File

@@ -140,28 +140,6 @@ public:
QColor gamma,
QColor blacklevel,
QColor whitelevel);
///
/// Set the color correction of the leds
///
/// @note Note that providing a NULL will leave the settings on the server unchanged
///
/// @param correctionId The identifier of the correction to set
/// @param correction The correction values
void setCorrection(
QString &correctionId,
const QColor & correction);
///
/// Set the color temperature of the leds
///
/// @note Note that providing a NULL will leave the settings on the server unchanged
///
/// @param temperatureId The identifier of the correction to set
/// @param temperature The temperature correction values
void setTemperature(
const QString & temperatureId,
const QColor & temperature);
///
/// Set the color adjustment of the leds

View File

@@ -79,10 +79,6 @@ int main(int argc, char * argv[])
ColorOption & argWhitelevel = parser.add<ColorOption> ('w', "whitelevel", "!DEPRECATED! Will be removed soon! Set the whitelevel of the leds (requires colors in hex format as RRGGBB which are normally between 0.0 and 1.0)");
BooleanOption & argPrint = parser.add<BooleanOption>(0x0, "print" , "Print the json input and output messages on stdout");
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help" , "Show this help message and exit");
Option & argIdC = parser.add<Option> ('y', "qualifier-c" , "!DEPRECATED! Will be removed soon! Identifier(qualifier) of the correction to set");
ColorOption & argCorrection = parser.add<ColorOption> ('Y', "correction" , "!DEPRECATED! Will be removed soon! Set the correction of the leds (requires colors in hex format as RRGGBB)");
Option & argIdT = parser.add<Option> ('z', "qualifier-t" , "Identifier(qualifier) of the temperature correction to set");
ColorOption & argTemperature = parser.add<ColorOption> ('Z', "temperature" , "Set the temperature correction of the leds (requires colors in hex format as RRGGBB)");
Option & argIdA = parser.add<Option> ('j', "qualifier-a" , "Identifier(qualifier) of the adjustment to set");
ColorOption & argRAdjust = parser.add<ColorOption> ('R', "redAdjustment" , "Set the adjustment of the red color (requires colors in hex format as RRGGBB)");
ColorOption & argGAdjust = parser.add<ColorOption> ('G', "greenAdjustment", "Set the adjustment of the green color (requires colors in hex format as RRGGBB)");
@@ -106,7 +102,7 @@ int main(int argc, char * argv[])
// check if at least one of the available color transforms is set
bool colorTransform = parser.isSet(argSaturation) || parser.isSet(argValue) || parser.isSet(argSaturationL) || parser.isSet(argLuminance) || parser.isSet(argLuminanceMin) || parser.isSet(argThreshold) || parser.isSet(argGamma) || parser.isSet(argBlacklevel) || parser.isSet(argWhitelevel);
bool colorAdjust = parser.isSet(argRAdjust) || parser.isSet(argGAdjust) || parser.isSet(argBAdjust);
bool colorModding = colorTransform || colorAdjust || parser.isSet(argCorrection) || parser.isSet(argTemperature);
bool colorModding = colorTransform || colorAdjust;
// check that exactly one command was given
int commandCount = count({parser.isSet(argColor), parser.isSet(argImage), parser.isSet(argEffect), parser.isSet(argServerInfo), parser.isSet(argClear), parser.isSet(argClearAll), parser.isSet(argEnableComponent), parser.isSet(argDisableComponent), colorModding, parser.isSet(argSource), parser.isSet(argSourceAuto), parser.isSet(argSourceOff), parser.isSet(argConfigGet), parser.isSet(argSchemaGet), parser.isSet(argConfigSet)});
@@ -135,10 +131,6 @@ int main(int argc, char * argv[])
showHelp(argGamma);
showHelp(argBlacklevel);
showHelp(argWhitelevel);
showHelp(argIdC);
showHelp(argCorrection);
showHelp(argIdT);
showHelp(argTemperature);
showHelp(argIdA);
showHelp(argRAdjust);
showHelp(argGAdjust);
@@ -212,16 +204,6 @@ int main(int argc, char * argv[])
}
else if (colorModding)
{
if (parser.isSet(argCorrection))
{
connection.setTemperature(argIdC.value(parser), argCorrection.getColor(parser));
}
if (parser.isSet(argTemperature))
{
connection.setTemperature(argIdT.value(parser), argTemperature.getColor(parser));
}
if (colorAdjust)
{
connection.setAdjustment(