FastLED 3.10.8
Loading...
Searching...
No Matches
five_bit_hd_gamma.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "fl/stl/int.h"
7#include "fl/stl/span.h"
8#include "fl/stl/noexcept.h"
9
10namespace fl {
11
12// Packed gamma-corrected pixel: 3 bytes RGB + 1 byte 5-bit brightness.
13// 4 bytes total, cache-friendly for bulk output.
18
23
24// Applies five-bit HD gamma correction over a span of pixels.
25// colors_scale and global_brightness are uniform across all pixels.
26// Two-span output variant (separate color and brightness arrays).
28 fl::span<const CRGB> colors, CRGB colors_scale, fl::u8 global_brightness,
29 fl::span<CRGB> out_colors, fl::span<fl::u8> out_power_5bit) FL_NO_EXCEPT;
30
31// Packed CRGBA5 output variant (cache-friendly single array).
33 fl::span<const CRGB> colors, CRGB colors_scale, fl::u8 global_brightness,
35
36// A joint code/field solve on one pixel of 16-bit *linear* drives -- what a
37// colour-managed channel already holds, so no gamma and no brightness are
38// applied here (the pipeline did both). Picks the smallest 5-bit field that
39// carries the brightest channel, no lower than `min_field` -- B1's flicker
40// floor for APA102's slow-PWM field (#4042) -- and rounds the codes at it.
41// Emitted light (code x field) never falls as a drive rises. `min_field` 31
42// pins the field, as for SK9822.
43// Internal: the only caller is PixelIterator's managed HD writer.
44namespace detail {
45void five_bit_hd_solve16(fl::u16 r16, fl::u16 g16, fl::u16 b16,
46 fl::u8 min_field, CRGB* out,
47 fl::u8* out_field) FL_NO_EXCEPT;
48} // namespace detail
49
50} // namespace fl
fl::CRGB CRGB
Definition crgb.h:25
void five_bit_hd_solve16(u16 r16, u16 g16, u16 b16, u8 min_field, CRGB *out, u8 *out_field) FL_NO_EXCEPT
unsigned char u8
Definition s16x16x4.h:132
unsigned char u8
Definition stdint.h:131
FiveBitGammaCorrectionMode
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
FL_OPTIMIZE_FUNCTION void five_bit_hd_gamma_bitshift(fl::span< const CRGB > colors, CRGB colors_scale, u8 global_brightness, fl::span< CRGB > out_colors, fl::span< u8 > out_power_5bit) FL_NO_EXCEPT
Base definition for an LED controller.
#define FL_NO_EXCEPT
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38