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

Function invalidate_colorimetric_caches_for

src/fl/gfx/rgbw.cpp.hpp:364–376  ·  view source on GitHub ↗

Drop both the ProfileCache and the LUT cache when `profile` matches the current cache key. set_input_gamut() mutates input_xy_* in place without touching the profile pointer or CCT, so the (pointer, cct) cache key stays equal and would otherwise serve stale M_src / LUT data.

Source from the content-addressed store, hash-verified

362// touching the profile pointer or CCT, so the (pointer, cct) cache key
363// stays equal and would otherwise serve stale M_src / LUT data.
364void invalidate_colorimetric_caches_for(const DiodeProfile* profile) FL_NOEXCEPT {
365 ColorimetricCacheHolder& ch =
366 fl::Singleton<ColorimetricCacheHolder>::instance();
367 if (ch.cached_for == profile) {
368 ch.cached_for = nullptr;
369 ch.cached_cct = 0;
370 }
371 LutStateHolder& lh = fl::Singleton<LutStateHolder>::instance();
372 if (lh.built_for == profile) {
373 lh.built_for = nullptr;
374 lh.built_cct = 0;
375 }
376}
377} // namespace
378
379void rgb_2_rgbw_colorimetric(u16 w_color_temperature, u8 r,

Callers 1

set_input_gamutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected