mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Added default values for color transform configuration.
Former-commit-id: a0d7c9279d5789ea3d19c8bb3004e1f596c39623
This commit is contained in:
parent
8d53c765c3
commit
6756db2417
Binary file not shown.
@ -1 +1 @@
|
||||
eec9520a7c9861d27e5944da29ba31a5fcee41eb
|
||||
a0d2edb5c6043c421c8efc82a4b86edaa6d8837e
|
@ -43,15 +43,18 @@ LedDevice* Hyperion::constructDevice(const Json::Value& deviceConfig)
|
||||
|
||||
HsvTransform * Hyperion::createHsvTransform(const Json::Value & hsvConfig)
|
||||
{
|
||||
return new HsvTransform(hsvConfig["saturationGain"].asDouble(), hsvConfig["valueGain"].asDouble());
|
||||
const double saturationGain = hsvConfig.get("saturationGain", 1.0).asDouble();
|
||||
const double valueGain = hsvConfig.get("valueGain", 1.0).asDouble();
|
||||
|
||||
return new HsvTransform(saturationGain, valueGain);
|
||||
}
|
||||
|
||||
ColorTransform* Hyperion::createColorTransform(const Json::Value& colorConfig)
|
||||
{
|
||||
const double threshold = colorConfig["threshold"].asDouble();
|
||||
const double gamma = colorConfig["gamma"].asDouble();
|
||||
const double blacklevel = colorConfig["blacklevel"].asDouble();
|
||||
const double whitelevel = colorConfig["whitelevel"].asDouble();
|
||||
const double threshold = colorConfig.get("threshold", 0.0).asDouble();
|
||||
const double gamma = colorConfig.get("gamma", 1.0).asDouble();
|
||||
const double blacklevel = colorConfig.get("blacklevel", 0.0).asDouble();
|
||||
const double whitelevel = colorConfig.get("whitelevel", 1.0).asDouble();
|
||||
|
||||
ColorTransform* transform = new ColorTransform(threshold, gamma, blacklevel, whitelevel);
|
||||
return transform;
|
||||
|
Loading…
Reference in New Issue
Block a user