FastLED 3.10.6
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//
3// NOTE: a twin of this file lives in examples/MoodRing/auto_brightness.h.
4// Examples cannot include across directories, so the file is duplicated.
5// Fix both, or neither.
6#pragma once
7
8#include "FastLED.h"
9#include "fl/stl/span.h"
10
11// Average brightness of an LED strip as a percentage (0-100).
13
14// Map content brightness to an output brightness byte using a three-segment
15// compression curve:
16// below lowThreshold -> full brightness (255)
17// lowThreshold..high -> linear ramp down to maxBrightness
18// above highThreshold -> maxBrightness
19uint8_t applyBrightnessCompression(float inputBrightnessPercent,
20 uint8_t maxBrightness, float lowThreshold,
21 float highThreshold);
CRGB leds[1]
uint8_t applyBrightnessCompression(float inputBrightnessPercent, uint8_t maxBrightness, float lowThreshold, float highThreshold)
float getAverageBrightness(fl::span< const CRGB > leds)
unsigned char uint8_t
Definition stdint.h:208