Merge branch 'multi_colortransform'

Conflicts:
	CMakeLists.txt
	config/hyperion.config.json

Former-commit-id: 99c5d885d2ee876b33143e945a9280a652a6a2ff
This commit is contained in:
T. van der Zwan
2013-12-05 22:09:58 +01:00
31 changed files with 1542 additions and 445 deletions

View File

@@ -160,7 +160,7 @@ void JsonConnection::clearAll()
parseReply(reply);
}
void JsonConnection::setTransform(double * saturation, double * value, ColorTransformValues *threshold, ColorTransformValues *gamma, ColorTransformValues *blacklevel, ColorTransformValues *whitelevel)
void JsonConnection::setTransform(std::string * transformId, double * saturation, double * value, ColorTransformValues *threshold, ColorTransformValues *gamma, ColorTransformValues *blacklevel, ColorTransformValues *whitelevel)
{
std::cout << "Set color transforms" << std::endl;
@@ -169,6 +169,11 @@ void JsonConnection::setTransform(double * saturation, double * value, ColorTran
command["command"] = "transform";
Json::Value & transform = command["transform"];
if (transformId != nullptr)
{
transform["id"] = *transformId;
}
if (saturation != nullptr)
{
transform["saturationGain"] = *saturation;

View File

@@ -76,6 +76,7 @@ public:
///
/// @note Note that providing a NULL will leave the settings on the server unchanged
///
/// @param transformId The identifier of the transform to set
/// @param saturation The HSV saturation gain
/// @param value The HSV value gain
/// @param threshold The threshold
@@ -84,6 +85,7 @@ public:
/// @param whitelevel The whitelevel
///
void setTransform(
std::string * transformId,
double * saturation,
double * value,
ColorTransformValues * threshold,

View File

@@ -45,6 +45,7 @@ int main(int argc, char * argv[])
SwitchParameter<> & argServerInfo = parameters.add<SwitchParameter<> >('l', "list" , "List server info");
SwitchParameter<> & argClear = parameters.add<SwitchParameter<> >('x', "clear" , "Clear data for the priority channel provided by the -p option");
SwitchParameter<> & argClearAll = parameters.add<SwitchParameter<> >(0x0, "clearall" , "Clear data for all active priority channels");
StringParameter & argId = parameters.add<StringParameter> ('q', "qualifier" , "Identifier(qualifier) of the transform to set");
DoubleParameter & argSaturation = parameters.add<DoubleParameter> ('s', "saturation", "Set the HSV saturation gain of the leds");
DoubleParameter & argValue = parameters.add<DoubleParameter> ('v', "value" , "Set the HSV value gain of the leds");
TransformParameter & argGamma = parameters.add<TransformParameter>('g', "gamma" , "Set the gamma of the leds (requires 3 space seperated values)");
@@ -83,6 +84,7 @@ int main(int argc, char * argv[])
std::cerr << " " << argClear.usageLine() << std::endl;
std::cerr << " " << argClearAll.usageLine() << std::endl;
std::cerr << "or one or more of the available color transformations:" << std::endl;
std::cerr << " " << argId.usageLine() << std::endl;
std::cerr << " " << argSaturation.usageLine() << std::endl;
std::cerr << " " << argValue.usageLine() << std::endl;
std::cerr << " " << argThreshold.usageLine() << std::endl;
@@ -119,9 +121,11 @@ int main(int argc, char * argv[])
}
else if (colorTransform)
{
std::string transId;
double saturation, value;
ColorTransformValues threshold, gamma, blacklevel, whitelevel;
if (argId.isSet()) transId = argId.getValue();
if (argSaturation.isSet()) saturation = argSaturation.getValue();
if (argValue.isSet()) value = argValue.getValue();
if (argThreshold.isSet()) threshold = argThreshold.getValue();
@@ -130,6 +134,7 @@ int main(int argc, char * argv[])
if (argWhitelevel.isSet()) whitelevel = argWhitelevel.getValue();
connection.setTransform(
argId.isSet() ? &transId : nullptr,
argSaturation.isSet() ? &saturation : nullptr,
argValue.isSet() ? &value : nullptr,
argThreshold.isSet() ? &threshold : nullptr,