mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Stronger dimming
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user