FastLED 3.9.15
Loading...
Searching...
No Matches
auto_brightness.h
Go to the documentation of this file.
1// auto_brightness.h - Content-aware brightness compression for LED strips
2#pragma once
3
4#include "FastLED.h"
5
6// Average brightness of an LED array as a percentage (0-100).
7float getAverageBrightness(CRGB *leds, int numLeds);
8
9// Map content brightness to an output brightness byte using a three-segment
10// compression curve:
11// below lowThreshold -> full brightness (255)
12// lowThreshold..high -> linear ramp down to maxBrightness
13// above highThreshold -> maxBrightness
14uint8_t applyBrightnessCompression(float inputBrightnessPercent,
15 uint8_t maxBrightness, float lowThreshold,
16 float highThreshold);
fl::CRGB leds[NUM_LEDS]
uint8_t applyBrightnessCompression(float inputBrightnessPercent, uint8_t maxBrightness, float lowThreshold, float highThreshold)
float getAverageBrightness(CRGB *leds, int numLeds)
fl::CRGB CRGB
Definition crgb.h:25
unsigned char uint8_t
Definition s16x16x4.h:209