allow gamma corrected preview without gamma corrected LEDs

This commit is contained in:
Frank
2023-08-05 00:06:58 +02:00
parent f010adfe24
commit 8e678ffa5e
4 changed files with 18 additions and 7 deletions

View File

@@ -358,8 +358,9 @@ static void calcInvGammaTable(float gamma)
}
}
uint8_t unGamma8(uint8_t value) {
if (!gammaCorrectCol || (value == 0) || (value == 255)) return value;
if ((gammaCorrectVal <= 1.0f) || (gammaCorrectVal > 3.0f)) return value;
//if (!gammaCorrectCol || (value == 0) || (value == 255)) return value;
if ((value == 0) || (value == 255)) return value;
if ((gammaCorrectVal < 0.999f) || (gammaCorrectVal > 3.0f)) return value;
if (gammaTinv[255] == 0) calcInvGammaTable(gammaCorrectVal);
return gammaTinv[value];
}