MCPcopy Create free account
hub / github.com/FastLED/FastLED / gamma_lut_read

Function gamma_lut_read

src/fl/gfx/five_bit_hd_gamma.cpp.hpp:23–25  ·  view source on GitHub ↗

Inlined gamma lookup with alignment enforced by aligned_ptr type. Avoids cross-TU function call overhead of gamma_2_8() in hot span loops.

Source from the content-addressed store, hash-verified

21// Inlined gamma lookup with alignment enforced by aligned_ptr type.
22// Avoids cross-TU function call overhead of gamma_2_8() in hot span loops.
23FL_ALWAYS_INLINE u16 gamma_lut_read(aligned_ptr<const u16, 64> lut, u8 idx) {
24 return FL_PGM_READ_WORD_ALIGNED(&lut[idx]);
25}
26
27// Branchless scale16by8: (i * (1 + scale)) >> 8.
28// Eliminates the if(scale==0) branch from the standard scale16by8.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected