FastLED
3.9.15
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
10
namespace
fl
{
11
12
// Packed gamma-corrected pixel: 3 bytes RGB + 1 byte 5-bit brightness.
13
// 4 bytes total, cache-friendly for bulk output.
14
struct
CRGBA5
{
15
CRGB
color
;
16
u8
brightness_5bit
;
17
};
18
19
enum class
FiveBitGammaCorrectionMode
{
20
kFiveBitGammaCorrectionMode_Null
= 0,
21
kFiveBitGammaCorrectionMode_BitShift
= 1
22
};
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).
27
void
five_bit_hd_gamma_bitshift
(
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_NOEXCEPT
;
30
31
// Packed CRGBA5 output variant (cache-friendly single array).
32
void
five_bit_hd_gamma_bitshift
(
33
fl::span<const CRGB>
colors,
CRGB
colors_scale,
fl::u8
global_brightness,
34
fl::span<CRGBA5>
out)
FL_NOEXCEPT
;
35
36
}
// namespace fl
fl::span
Definition
span.h:385
CRGB
fl::CRGB CRGB
Definition
crgb.h:25
int.h
fl::u8
unsigned char u8
Definition
stdint.h:131
fl::FiveBitGammaCorrectionMode
FiveBitGammaCorrectionMode
Definition
five_bit_hd_gamma.h:19
fl::FiveBitGammaCorrectionMode::kFiveBitGammaCorrectionMode_Null
@ kFiveBitGammaCorrectionMode_Null
Definition
five_bit_hd_gamma.h:20
fl::FiveBitGammaCorrectionMode::kFiveBitGammaCorrectionMode_BitShift
@ kFiveBitGammaCorrectionMode_BitShift
Definition
five_bit_hd_gamma.h:21
fl::five_bit_hd_gamma_bitshift
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)
Definition
five_bit_hd_gamma.cpp.hpp:83
fl
Base definition for an LED controller.
Definition
crgb.hpp:179
fl::CRGBA5::color
CRGB color
Definition
five_bit_hd_gamma.h:15
fl::CRGBA5::brightness_5bit
u8 brightness_5bit
Definition
five_bit_hd_gamma.h:16
fl::CRGBA5
Definition
five_bit_hd_gamma.h:14
noexcept.h
FL_NOEXCEPT
#define FL_NOEXCEPT
span.h
fl::CRGB
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition
crgb.h:38
fl
gfx
five_bit_hd_gamma.h
Generated on Tue Jun 16 2026 00:06:59 for FastLED by
1.13.2