FastLED 3.9.15
Loading...
Searching...
No Matches

◆ applyGamma_video() [3/3]

uint8_t applyGamma_video ( uint8_t brightness,
float gamma )

Applies a gamma adjustment to a color channel.

Parameters
brightnessthe value of the color data
gammathe gamma value to apply
Returns
the color data, adjusted for gamma

Definition at line 1395 of file colorutils.cpp.

1396{
1397 float orig;
1398 float adj;
1399 orig = (float)(brightness) / (255.0);
1400 adj = pow( orig, gamma) * (255.0);
1401 uint8_t result = (uint8_t)(adj);
1402 if( (brightness > 0) && (result == 0)) {
1403 result = 1; // never gamma-adjust a positive number down to zero
1404 }
1405 return result;
1406}
UISlider brightness("Brightness", 255, 0, 255, 1)

References brightness.

Referenced by applyGamma_video(), applyGamma_video(), napplyGamma_video(), napplyGamma_video(), napplyGamma_video(), and napplyGamma_video().

+ Here is the caller graph for this function: