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

Function UpscalePaletteRepeat

src/fl/gfx/colorutils.cpp.hpp:1185–1197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1183
1184template <typename TSrcPalette, typename TDestPalette>
1185void UpscalePaletteRepeat(const TSrcPalette &srcpal,
1186 TDestPalette &destpal) {
1187 const fl::u16 src_size = sizeof(srcpal.entries) / sizeof(srcpal.entries[0]);
1188 const fl::u16 dest_size =
1189 sizeof(destpal.entries) / sizeof(destpal.entries[0]);
1190 const fl::u16 repeat = dest_size / src_size;
1191 for (fl::u16 i = 0; i < src_size; ++i) {
1192 const fl::u16 start = i * repeat;
1193 for (fl::u16 j = 0; j < repeat; ++j) {
1194 destpal[static_cast<fl::u8>(start + j)] = srcpal[static_cast<fl::u8>(i)];
1195 }
1196 }
1197}
1198
1199template <typename TSrcPalette, typename TDestPalette>
1200void UpscalePaletteInterpolated(const TSrcPalette &srcpal,

Callers 1

UpscalePaletteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected