Remove gamma value lower limit to enable inverse gamma correction (#5187)
* Enable inverse gamma correction (gamma < 1.0) Allow gamma values from 0.1 to 3.0 instead of restricting to > 1.0. This enables inverse gamma curves for use cases requiring brightened mid-tones and compressed highlights. Changes: - Update backend validation in set.cpp and cfg.cpp to accept 0.1-3.0 - Update HTML form min value from 1 to 0.1 Co-authored-by: Flo <flo@Mac.lan> Co-authored-by: Damian Schneider <daedae@gmx.ch>
This commit is contained in:
@@ -378,7 +378,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
|
||||
gammaCorrectBri = request->hasArg(F("GB"));
|
||||
gammaCorrectCol = request->hasArg(F("GC"));
|
||||
gammaCorrectVal = request->arg(F("GV")).toFloat();
|
||||
if (gammaCorrectVal <= 1.0f || gammaCorrectVal > 3) {
|
||||
if (gammaCorrectVal < 0.1f || gammaCorrectVal > 3) {
|
||||
gammaCorrectVal = 1.0f; // no gamma correction
|
||||
gammaCorrectBri = false;
|
||||
gammaCorrectCol = false;
|
||||
|
||||
Reference in New Issue
Block a user