marmil

dim8_gamma_correction.txt

Jan 22nd, 2018
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. // Cheap (ie. fast) gamma correction (contrast adjustment) that can be run right before calling FastLED.show()
  2. void adjust_gamma()
  3. {
  4.   for (uint16_t i = 0; i < NUM_LEDS; i++)
  5.   {
  6.     leds[i].r = dim8_video(leds[i].r);
  7.     leds[i].g = dim8_video(leds[i].g);
  8.     leds[i].b = dim8_video(leds[i].b);
  9.   }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment