FastLED 3.10.6
Loading...
Searching...
No Matches

◆ decodeTransferU16()

u16 fl::decodeTransferU16 ( TransferFunction transfer,
u8 code )

Decode one 8-bit source code to u16 linear light under transfer.

Exact at both endpoints: code 0 -> 0, code 255 -> 65535.

Definition at line 79 of file transfer.cpp.hpp.

79 {
80 switch (transfer) {
82 return FL_PGM_READ_WORD_ALIGNED(&SRGB_DECODE_LUT[code]);
84 return FL_PGM_READ_WORD_ALIGNED(&BT709_DECODE_LUT[code]);
86 break;
87 }
88 // Linear needs no table: 257 maps 0..255 onto 0..65535 exactly, so 0 and
89 // 255 land on the endpoints without a rounding step.
90 return static_cast<u16>(static_cast<u32>(code) * 257u);
91}
#define FL_PGM_READ_WORD_ALIGNED(addr)

References Bt709, FL_NO_EXCEPT, FL_PGM_READ_WORD_ALIGNED, Linear, and Srgb.

Referenced by processPixelLinearQ16(), and processPixelWideLinearQ16().

+ Here is the caller graph for this function: