FastLED 3.9.7
|
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 | |
uint8_t | applyGamma_video (uint8_t brightness, float gamma) |
Applies a gamma adjustment to a color channel. | |
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. | |
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. | |
Applies a gamma adjustment to a color.
orig | the color to apply an adjustment to |
gamma | the gamma value to apply |
Definition at line 1370 of file colorutils.cpp.
Applies a gamma adjustment to a color.
orig | the color to apply an adjustment to |
gammaR | the gamma value to apply to the CRGB::red channel |
gammaG | the gamma value to apply to the CRGB::green channel |
gammaB | the gamma value to apply to the CRGB::blue channel |
Definition at line 1379 of file colorutils.cpp.
uint8_t applyGamma_video | ( | uint8_t | brightness, |
float | gamma ) |
Applies a gamma adjustment to a color channel.
brightness | the value of the color data |
gamma | the gamma value to apply |
Definition at line 1357 of file colorutils.cpp.
Destructively applies a gamma adjustment to a color.
rgb | the color to apply an adjustment to (modified in place) |
gamma | the gamma value to apply |
Definition at line 1388 of file colorutils.cpp.
Destructively applies a gamma adjustment to a color.
rgb | the color to apply an adjustment to (modified in place) |
gammaR | the gamma value to apply to the CRGB::red channel |
gammaG | the gamma value to apply to the CRGB::green channel |
gammaB | the gamma value to apply to the CRGB::blue channel |
Definition at line 1394 of file colorutils.cpp.
void napplyGamma_video | ( | CRGB * | rgbarray, |
uint16_t | count, | ||
float | gamma ) |
Destructively applies a gamma adjustment to a color array.
rgbarray | pointer to an LED array to apply an adjustment to (modified in place) |
count | the number of LEDs to modify |
gamma | the gamma value to apply |
Definition at line 1400 of file colorutils.cpp.
void napplyGamma_video | ( | CRGB * | rgbarray, |
uint16_t | count, | ||
float | gammaR, | ||
float | gammaG, | ||
float | gammaB ) |
Destructively applies a gamma adjustment to a color array.
rgbarray | pointer to an LED array to apply an adjustment to (modified in place) |
count | the number of LEDs to modify |
gammaR | the gamma value to apply to the CRGB::red channel |
gammaG | the gamma value to apply to the CRGB::green channel |
gammaB | the gamma value to apply to the CRGB::blue channel |
Definition at line 1407 of file colorutils.cpp.