experimental: preview with gamma correction

.... actually we undo gamma adjustments, because screens (laptop, pad, etc) will apply their own gamma corrections.

Activate in LED settings: "Use Gamma correction for preview"

Colors in WLED are sometimes gamma corrected, sometimes not. This change tries to make the best out of the color mess, but its still not working properly in all configurations.
This commit is contained in:
Frank
2023-08-04 22:03:53 +02:00
parent 477cb11b36
commit f010adfe24
9 changed files with 531 additions and 489 deletions

View File

@@ -239,10 +239,19 @@ static bool sendLiveLedsWs(uint32_t wsClient) // WLEDMM added "static"
{
//WLEDMM: no skipLines
uint32_t c = restoreColorLossy(strip.getPixelColor(i), stripBrightness); // WLEDMM full bright preview - does _not_ recover ABL reductions
uint8_t w = W(c); // WLEDMM small optimization
buffer[pos++] = qadd8(w, R(c)); //R, add white channel to RGB channels as a simple RGBW -> RGB map
buffer[pos++] = qadd8(w, G(c)); //G
buffer[pos++] = qadd8(w, B(c)); //B
// WLEDMM begin: preview with color gamma correction
if (gammaCorrectPreview && gammaCorrectCol) {
uint8_t w = W(c); // not sure why, but it looks better if using "white" without corrections
buffer[pos++] = qadd8(w, unGamma8(R(c))); //R, add white channel to RGB channels as a simple RGBW -> RGB map
buffer[pos++] = qadd8(w, unGamma8(G(c))); //G
buffer[pos++] = qadd8(w, unGamma8(B(c))); //B
} else {
// WLEDMM end
uint8_t w = W(c); // WLEDMM small optimization
buffer[pos++] = qadd8(w, R(c)); //R, add white channel to RGB channels as a simple RGBW -> RGB map
buffer[pos++] = qadd8(w, G(c)); //G
buffer[pos++] = qadd8(w, B(c)); //B
}
}
wsc->binary(wsBuf);