hyperion-project / hyperion.ng

The successor to Hyperion aka Hyperion Next Generation
https://hyperion-project.org/
MIT License
3.02k stars 375 forks source link

Add ability or move or shift gamma curve relative to the others rather than changing the curve #499

Open Iridahonda opened 6 years ago

Iridahonda commented 6 years ago

My APA102 LEDS have a gamma offsets between the colours. I.e. the leds follow the same brightness curves but they shifted relative to each other. By shifting the curves in the gamma array by 2 or 3 in the array I can achieve near perfect white light from just on to full brightness. Below is my poor attempt at coding to shift the green curve by 3 in the array. Would be great if someone that knows what they are doing could make a proper delta adjustment to the json config and web.

if ( _gammaG > 2 )
 {
  for (int i = 0; i < 256; ++i)
    {
            if ( i >= 3 )
            {
            b = i-3;
            }

_mappingR[i] = qMin(qMax((int)(qPow(i / 255.0, _gammaR) * 255), 0), 255);
_mappingG[b] = qMin(qMax((int)(qPow(i / 255.0, _gammaG) * 255), 0), 255);
_mappingB[i] = qMin(qMax((int)(qPow(i / 255.0, _gammaB) * 255), 0), 255);
penfold42 commented 6 years ago

What if you adjusted the green channel brightness settings as well ?

A different green brightness with possible a different gamma value should mathematically get what you need

Iridahonda commented 6 years ago

I don't seem able to get it right by changing the builtin green and gamma settings. Low light levels are a particular problem. I think there is some non linearity in my leds at the bottom end. Maybe I need an adjustable look up table for each bightness value.
We should delete/remove this request as its probably unique to my setup.

penfold42 commented 6 years ago

What’s your capture device ? Maybe it’s providing inconsistent R G B values

Iridahonda commented 6 years ago

I originally had a UTV007 lightberry but have now changed to a Magewell USB Gen 2