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).
7
float
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
14
uint8_t
applyBrightnessCompression
(
float
inputBrightnessPercent,
15
uint8_t maxBrightness,
float
lowThreshold,
16
float
highThreshold);
leds
fl::CRGB leds[NUM_LEDS]
Definition
Animartrix.ino:93
applyBrightnessCompression
uint8_t applyBrightnessCompression(float inputBrightnessPercent, uint8_t maxBrightness, float lowThreshold, float highThreshold)
Definition
auto_brightness.cpp:13
getAverageBrightness
float getAverageBrightness(CRGB *leds, int numLeds)
Definition
auto_brightness.cpp:4
CRGB
fl::CRGB CRGB
Definition
crgb.h:25
fl::uint8_t
unsigned char uint8_t
Definition
s16x16x4.h:209
examples
AnimartrixRing
auto_brightness.h
Generated on Tue Jun 16 2026 00:06:58 for FastLED by
1.13.2