FastLED 3.9.15
|
Functions for applying gamma adjustments to LED data.
Gamma correction tries to compensate for the non-linear manner in which humans perceive light and color. Gamma correction is applied using the following expression:
Larger gamma values result in darker images that have more contrast. Lower gamma values result in lighter images with less contrast.
These functions apply either:
Note that the gamma is specified as a traditional floating point value, e.g., "2.5", and as such these functions should not be called in your innermost pixel loops, or in animations that are extremely low on program storage space. Nevertheless, if you need these functions, here they are.
Furthermore, bear in mind that CRGB LEDs have only eight bits per channel of color resolution, and that very small, subtle shadings may not be visible.
Functions | |
CRGB | applyGamma_video (const CRGB &orig, float gamma) |
Applies a gamma adjustment to a color. | |
CRGB | applyGamma_video (const CRGB &orig, float gammaR, float gammaG, float gammaB) |
Applies a gamma adjustment to a color. | |
uint8_t | applyGamma_video (uint8_t brightness, float gamma) |
Applies a gamma adjustment to a color channel. | |
CRGB & | napplyGamma_video (CRGB &rgb, float gamma) |
Destructively applies a gamma adjustment to a color. | |
CRGB & | napplyGamma_video (CRGB &rgb, float gammaR, float gammaG, float gammaB) |
Destructively applies a gamma adjustment to a color. | |
void | napplyGamma_video (CRGB *rgbarray, uint16_t count, float gamma) |
Destructively applies a gamma adjustment to a color array. | |
void | napplyGamma_video (CRGB *rgbarray, uint16_t count, float gammaR, float gammaG, float gammaB) |
Destructively applies a gamma adjustment to a color array. | |