Minimum luminance for backlight in dark scenes (#646)

* Include miminum luminance

* Add luminance minimum

* Add luminance minimum

* fixed missing ;

* Add luminance minimum

* Add luminance minimum check

Check if luminance mimimum is other than default

* Add luminance minimum

* Add luminance minimum

* Add luminance minimum

* Add luminance minimum

* Add luminance minimum

* Safe luminance calculation


Former-commit-id: 35a762b18b473a333155acba7a00894204400076
This commit is contained in:
Funatiq
2016-05-23 00:00:48 +02:00
committed by brindosch
parent e944ce46cd
commit f8b724f9f9
9 changed files with 69 additions and 10 deletions

View File

@@ -192,7 +192,7 @@ void JsonConnection::clearAll()
parseReply(reply);
}
void JsonConnection::setTransform(std::string * transformId, double * saturation, double * value, double * saturationL, double * luminance, ColorTransformValues *threshold, ColorTransformValues *gamma, ColorTransformValues *blacklevel, ColorTransformValues *whitelevel)
void JsonConnection::setTransform(std::string * transformId, double * saturation, double * value, double * saturationL, double * luminance, double * luminanceMin, ColorTransformValues *threshold, ColorTransformValues *gamma, ColorTransformValues *blacklevel, ColorTransformValues *whitelevel)
{
std::cout << "Set color transforms" << std::endl;
@@ -225,6 +225,12 @@ void JsonConnection::setTransform(std::string * transformId, double * saturation
{
transform["luminanceGain"] = *luminance;
}
if (luminanceMin != nullptr)
{
transform["luminanceMinimum"] = *luminanceMin;
}
if (threshold != nullptr)
{
Json::Value & v = transform["threshold"];

View File

@@ -93,6 +93,7 @@ public:
/// @param value The HSV value gain
/// @param saturationL The HSL saturation gain
/// @param luminance The HSL luminance gain
/// @param luminanceMin The HSL luminance minimum
/// @param threshold The threshold
/// @param gamma The gamma value
/// @param blacklevel The blacklevel
@@ -104,6 +105,7 @@ public:
double * value,
double * saturationL,
double * luminance,
double * luminanceMin,
ColorTransformValues * threshold,
ColorTransformValues * gamma,
ColorTransformValues * blacklevel,

View File

@@ -71,6 +71,7 @@ int main(int argc, char * argv[])
DoubleParameter & argValue = parameters.add<DoubleParameter> ('v', "value" , "!DEPRECATED! Will be removed soon! Set the HSV value gain of the leds");
DoubleParameter & argSaturationL = parameters.add<DoubleParameter> ('u', "saturationL", "Set the HSL saturation gain of the leds");
DoubleParameter & argLuminance = parameters.add<DoubleParameter> ('m', "luminance" , "Set the HSL luminance gain of the leds");
DoubleParameter & argLuminanceMin = parameters.add<DoubleParameter> ('n', "luminanceMin" , "Set the HSL luminance minimum of the leds (backlight)");
TransformParameter & argGamma = parameters.add<TransformParameter>('g', "gamma" , "Set the gamma of the leds (requires 3 space seperated values)");
TransformParameter & argThreshold = parameters.add<TransformParameter>('t', "threshold" , "Set the threshold of the leds (requires 3 space seperated values between 0.0 and 1.0)");
TransformParameter & argBlacklevel = parameters.add<TransformParameter>('b', "blacklevel", "!DEPRECATED! Will be removed soon! Set the blacklevel of the leds (requires 3 space seperated values which are normally between 0.0 and 1.0)");
@@ -103,7 +104,7 @@ int main(int argc, char * argv[])
}
// check if at least one of the available color transforms is set
bool colorTransform = argSaturation.isSet() || argValue.isSet() || argSaturationL.isSet() || argLuminance.isSet() || argThreshold.isSet() || argGamma.isSet() || argBlacklevel.isSet() || argWhitelevel.isSet();
bool colorTransform = argSaturation.isSet() || argValue.isSet() || argSaturationL.isSet() || argLuminance.isSet() || argLuminanceMin.isSet() || argThreshold.isSet() || argGamma.isSet() || argBlacklevel.isSet() || argWhitelevel.isSet();
bool colorAdjust = argRAdjust.isSet() || argGAdjust.isSet() || argBAdjust.isSet();
bool colorModding = colorTransform || colorAdjust || argCorrection.isSet() || argTemperature.isSet();
@@ -124,6 +125,7 @@ int main(int argc, char * argv[])
std::cerr << " " << argValue.usageLine() << std::endl;
std::cerr << " " << argSaturationL.usageLine() << std::endl;
std::cerr << " " << argLuminance.usageLine() << std::endl;
std::cerr << " " << argLuminanceMin.usageLine() << std::endl;
std::cerr << " " << argThreshold.usageLine() << std::endl;
std::cerr << " " << argGamma.usageLine() << std::endl;
std::cerr << " " << argBlacklevel.usageLine() << std::endl;
@@ -216,7 +218,7 @@ int main(int argc, char * argv[])
if (colorTransform)
{
std::string transId;
double saturation, value, saturationL, luminance;
double saturation, value, saturationL, luminance, luminanceMin;
ColorTransformValues threshold, gamma, blacklevel, whitelevel;
if (argId.isSet()) transId = argId.getValue();
@@ -224,6 +226,7 @@ int main(int argc, char * argv[])
if (argValue.isSet()) value = argValue.getValue();
if (argSaturationL.isSet()) saturationL = argSaturationL.getValue();
if (argLuminance.isSet()) luminance = argLuminance.getValue();
if (argLuminanceMin.isSet()) luminanceMin = argLuminanceMin.getValue();
if (argThreshold.isSet()) threshold = argThreshold.getValue();
if (argGamma.isSet()) gamma = argGamma.getValue();
if (argBlacklevel.isSet()) blacklevel = argBlacklevel.getValue();
@@ -235,6 +238,7 @@ int main(int argc, char * argv[])
argValue.isSet() ? &value : nullptr,
argSaturationL.isSet() ? &saturationL : nullptr,
argLuminance.isSet() ? &luminance : nullptr,
argLuminanceMin.isSet() ? &luminanceMin : nullptr,
argThreshold.isSet() ? &threshold : nullptr,
argGamma.isSet() ? &gamma : nullptr,
argBlacklevel.isSet() ? &blacklevel : nullptr,