From a5a17776d49e0f14604b626c7812b8fc2dfb5326 Mon Sep 17 00:00:00 2001 From: AEtHeLsYn Date: Sun, 13 Mar 2016 12:10:54 +0100 Subject: [PATCH] BugFix Former-commit-id: 8887ee93d5bcaa7ee13f4f5afb601a65d59ee113 --- config/hyperion.config.json | 31 ++++++++++++++ libsrc/hyperion/hyperion.schema.json | 42 +++++++++++++++++++ .../jsonserver/schema/schema-correction.json | 18 ++++---- .../jsonserver/schema/schema-temperature.json | 18 ++++---- src/hyperion-remote/hyperion-remote.cpp | 16 +++---- 5 files changed, 99 insertions(+), 26 deletions(-) diff --git a/config/hyperion.config.json b/config/hyperion.config.json index 8c9d1ecc..fbb61a69 100644 --- a/config/hyperion.config.json +++ b/config/hyperion.config.json @@ -42,6 +42,32 @@ /// - 'updateDelay' The delay of the output to leds (in periods of smoothing) "color" : { + "correction" : + [ + { + "id" : "default", + "leds" : "*", + "correctionValues" : + { + "red" : 255, + "green" : 255, + "blue" : 255 + } + } + ], + "temperature" : + [ + { + "id" : "default", + "leds" : "*", + "correctionValues" : + { + "red" : 255, + "green" : 255, + "blue" : 255 + } + } + ], "transform" : [ { @@ -52,6 +78,11 @@ "saturationGain" : 1.0000, "valueGain" : 1.0000 }, + "hsl" : + { + "saturationGain" : 1.0000, + "luminanceGain" : 1.0000 + },` "red" : { "threshold" : 0.0000, diff --git a/libsrc/hyperion/hyperion.schema.json b/libsrc/hyperion/hyperion.schema.json index e459425b..165bd906 100644 --- a/libsrc/hyperion/hyperion.schema.json +++ b/libsrc/hyperion/hyperion.schema.json @@ -38,6 +38,31 @@ "type":"object", "required":false, "properties": { + "correctionValues" : { + "type" : "object", + "required" : false, + "properties" : { + "red" : { + "type" : "integer", + "required" : false, + "minimum" : 0 + "maximum" : 255 + }, + "green" : { + "type" : "integer", + "required" : false, + "minimum" : 0 + "maximum" : 255 + } + "blue" : { + "type" : "integer", + "required" : false, + "minimum" : 0 + "maximum" : 255 + } + }, + "additionalProperties" : false + }, "hsv" : { "type" : "object", "required" : false, @@ -54,6 +79,23 @@ } }, "additionalProperties" : false + }, + "hsl" : { + "type" : "object", + "required" : false, + "properties" : { + "saturationGain" : { + "type" : "number", + "required" : false, + "minimum" : 0.0 + }, + "luminanceGain" : { + "type" : "number", + "required" : false, + "minimum" : 0.0 + } + }, + "additionalProperties" : false }, "red": { "type":"object", diff --git a/libsrc/jsonserver/schema/schema-correction.json b/libsrc/jsonserver/schema/schema-correction.json index f156d8fd..37bbee6f 100644 --- a/libsrc/jsonserver/schema/schema-correction.json +++ b/libsrc/jsonserver/schema/schema-correction.json @@ -16,22 +16,22 @@ "required" : false }, "red" : { - "type" : "number", + "type" : "integer", "required" : false, - "minimum": 0.0, - "maximum": 255.0 + "minimum": 0, + "maximum": 255 }, "green" : { - "type" : "number", + "type" : "integer", "required" : false, - "minimum": 0.0, - "maximum": 255.0 + "minimum": 0, + "maximum": 255 }, "blue" : { - "type" : "number", + "type" : "integer", "required" : false, - "minimum": 0.0, - "maximum": 255.0 + "minimum": 0, + "maximum": 255 } }, "additionalProperties": false diff --git a/libsrc/jsonserver/schema/schema-temperature.json b/libsrc/jsonserver/schema/schema-temperature.json index 1e2b7058..14ce465b 100644 --- a/libsrc/jsonserver/schema/schema-temperature.json +++ b/libsrc/jsonserver/schema/schema-temperature.json @@ -16,22 +16,22 @@ "required" : false }, "red" : { - "type" : "number", + "type" : "integer", "required" : false, - "minimum": 0.0, - "maximum": 255.0 + "minimum": 0, + "maximum": 255 }, "green" : { - "type" : "number", + "type" : "integer", "required" : false, - "minimum": 0.0, - "maximum": 255.0 + "minimum": 0, + "maximum": 255 }, "blue" : { - "type" : "number", + "type" : "integer", "required" : false, - "minimum": 0.0, - "maximum": 255.0 + "minimum": 0, + "maximum": 255 } }, "additionalProperties": false diff --git a/src/hyperion-remote/hyperion-remote.cpp b/src/hyperion-remote/hyperion-remote.cpp index 9d02011c..ee3530df 100644 --- a/src/hyperion-remote/hyperion-remote.cpp +++ b/src/hyperion-remote/hyperion-remote.cpp @@ -61,7 +61,7 @@ int main(int argc, char * argv[]) StringParameter & argId = parameters.add ('q', "qualifier" , "Identifier(qualifier) of the transform to set"); DoubleParameter & argSaturation = parameters.add ('s', "saturation", "Set the HSV saturation gain of the leds"); DoubleParameter & argValue = parameters.add ('v', "value" , "Set the HSV value gain of the leds"); - DoubleParameter & argSaturationL = parameters.add ('u', "saturationL", "Set the HSL saturation gain of the leds"); + DoubleParameter & argSaturationL = parameters.add ('u', "saturationL", "Set the HSL saturation gain of the leds"); DoubleParameter & argLuminance = parameters.add ('m', "luminance" , "Set the HSL luminance gain of the leds"); TransformParameter & argGamma = parameters.add('g', "gamma" , "Set the gamma of the leds (requires 3 space seperated values)"); TransformParameter & argThreshold = parameters.add('t', "threshold" , "Set the threshold of the leds (requires 3 space seperated values between 0.0 and 1.0)"); @@ -70,13 +70,13 @@ int main(int argc, char * argv[]) SwitchParameter<> & argPrint = parameters.add >(0x0, "print" , "Print the json input and output messages on stdout"); SwitchParameter<> & argHelp = parameters.add >('h', "help" , "Show this help message and exit"); StringParameter & argIdC = parameters.add ('y', "qualifier" , "Identifier(qualifier) of the correction to set"); - IntParameter & argCorrR = parameters.add ('1', "correctionR" , "Specify the red channel correction factor"); - IntParameter & argCorrG = parameters.add ('2', "correctionG" , "Specify the green channel correction factor"); - IntParameter & argCorrB = parameters.add ('3', "correctionB" , "Specify the blue channel correction factor"); + IntParameter & argCorrR = parameters.add ('1', "correctionR" , "Specify the red channel correction"); + IntParameter & argCorrG = parameters.add ('2', "correctionG" , "Specify the green channel correction"); + IntParameter & argCorrB = parameters.add ('3', "correctionB" , "Specify the blue channel correction"); StringParameter & argIdT = parameters.add ('z', "qualifier" , "Identifier(qualifier) of the temperature to set"); - IntParameter & argTempR = parameters.add ('4', "tempR" , "Specify the red channel temperature factor"); - IntParameter & argTempG = parameters.add ('5', "tempG" , "Specify the red channel temperature factor"); - IntParameter & argTempB = parameters.add ('6', "tempB" , "Specify the red channel temperature factor"); + IntParameter & argTempR = parameters.add ('4', "tempR" , "Specify the red channel temperature correction"); + IntParameter & argTempG = parameters.add ('5', "tempG" , "Specify the red channel temperature correction"); + IntParameter & argTempB = parameters.add ('6', "tempB" , "Specify the red channel temperature correction"); // set the default values argAddress.setDefault(defaultServerAddress.toStdString()); @@ -106,7 +106,7 @@ int main(int argc, char * argv[]) std::cerr << (commandCount == 0 ? "No command found." : "Multiple commands found.") << " Provide exactly one of the following options:" << std::endl; std::cerr << " " << argColor.usageLine() << std::endl; std::cerr << " " << argImage.usageLine() << std::endl; - std::cerr << " " << argEffect.usageLine() << std::endl; + std::cerr << " " << argEffect.usageLine() << std::endl; std::cerr << " " << argServerInfo.usageLine() << std::endl; std::cerr << " " << argClear.usageLine() << std::endl; std::cerr << " " << argClearAll.usageLine() << std::endl;