Stronger dimming

This commit is contained in:
Serge
2024-02-17 14:20:54 +01:00
parent 062301555c
commit 4fd087b19b

View File

@@ -82,10 +82,12 @@
private static ushort[] Brightness(ushort[] data, double brightness)
{
brightness = 0.5 + brightness / 2;
var result = new ushort[GammaRamp.DataPoints];
for (var i = 0; i < result.Length; i++)
{
if (brightness < 0.5)
result[i] = (ushort)(0.5 * ushort.MaxValue * Math.Pow((float)i/(result.Length - 1), 2 - brightness*2));
else
result[i] = (ushort)(data[i] * brightness);
}
return result;