mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Re-add Temperture adjustment (#1710)
* Add Temperature adjustment * Add Temperature adjustment - add missing cmake updates * Add missing ENABLE_MDNS guards * Reapply temperature on JSONAPI * Integrate color temperature into RGB transformations * Fix imagestream update * fix cast * Cleanups * Windows Fix * Fix inner loop * Simplify * Reapply default temperature setting * Fix adjustments calculation * Updates
This commit is contained in:
@@ -152,6 +152,13 @@
|
||||
"required" : false,
|
||||
"minimum" : 0.1,
|
||||
"maximum": 10.0
|
||||
},
|
||||
"temperature" :
|
||||
{
|
||||
"type" : "integer",
|
||||
"required" : false,
|
||||
"minimum" : 1000,
|
||||
"maximum": 40000
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include <utils/jsonschema/QJsonFactory.h>
|
||||
#include <utils/jsonschema/QJsonSchemaChecker.h>
|
||||
#include <utils/ColorSys.h>
|
||||
#include <utils/KelvinToRgb.h>
|
||||
#include <utils/Process.h>
|
||||
#include <utils/JsonUtils.h>
|
||||
|
||||
@@ -640,6 +641,7 @@ void JsonAPI::applyTransforms(const QJsonObject &adjustment, ColorAdjustment *co
|
||||
applyTransform("backlightColored", adjustment, colorAdjustment->_rgbTransform, &RgbTransform::setBacklightColored);
|
||||
applyTransform("brightness", adjustment, colorAdjustment->_rgbTransform, &RgbTransform::setBrightness);
|
||||
applyTransform("brightnessCompensation", adjustment, colorAdjustment->_rgbTransform, &RgbTransform::setBrightnessCompensation);
|
||||
applyTransform("temperature", adjustment, colorAdjustment->_rgbTransform, &RgbTransform::setTemperature);
|
||||
applyTransform("saturationGain", adjustment, colorAdjustment->_okhsvTransform, &OkhsvTransform::setSaturationGain);
|
||||
applyTransform("brightnessGain", adjustment, colorAdjustment->_okhsvTransform, &OkhsvTransform::setBrightnessGain);
|
||||
}
|
||||
@@ -669,6 +671,14 @@ void JsonAPI::applyTransform(const QString &transformName, const QJsonObject &ad
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void JsonAPI::applyTransform(const QString &transformName, const QJsonObject &adjustment, T &transform, void (T::*setFunction)(int))
|
||||
{
|
||||
if (adjustment.contains(transformName)) {
|
||||
(transform.*setFunction)(adjustment[transformName].toInt());
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void JsonAPI::applyTransform(const QString &transformName, const QJsonObject &adjustment, T &transform, void (T::*setFunction)(uint8_t))
|
||||
{
|
||||
|
@@ -84,6 +84,8 @@ QJsonArray JsonInfo::getAdjustmentInfo(const Hyperion* hyperion, Logger* log)
|
||||
adjustment["saturationGain"] = colorAdjustment->_okhsvTransform.getSaturationGain();
|
||||
adjustment["brightnessGain"] = colorAdjustment->_okhsvTransform.getBrightnessGain();
|
||||
|
||||
adjustment["temperature"] = colorAdjustment->_rgbTransform.getTemperature();
|
||||
|
||||
adjustmentArray.append(adjustment);
|
||||
}
|
||||
return adjustmentArray;
|
||||
|
Reference in New Issue
Block a user