Commit 92fa7fe
fl16-inputmodules: add gamma correction.
The brightness values sent to the LED controller actually control a PWM
duty cycle. LEDs emit light roughly in proportion to the PWM duty cycle,
but human vision perceives brightness on an exponential curve --
generally it takes 2x the physical luminous flux for the eye to perceive
something as one step brighter.
As a result, brightness ramps (like the one generated by
--all-brightnesses) were rapidly brightening to what appeared to be max,
and then flattening.
This change adds gamma correction, which maps the linear input
brightness values to a non-linear function of PWM duty cycles, causing
the ramp to look far more ramp-y.
The gamma value I've chosen here is arguably a preference, I messed with
output on a PVT panel until I found something that looked approximately
right.1 parent a548403 commit 92fa7fe
1 file changed
+13
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
| 317 | + | |
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
| |||
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
333 | | - | |
| 334 | + | |
334 | 335 | | |
335 | 336 | | |
| 337 | + | |
| 338 | + | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
| |||
387 | 390 | | |
388 | 391 | | |
389 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
0 commit comments