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

Method convertToLookUpTable

src/fl/math/xmap.cpp.hpp:40–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void XMap::convertToLookUpTable() {
41 if (type == kLookUpTable) {
42 return;
43 }
44 mLookUpTable.reset();
45 mLookUpTable = fl::make_shared<LUT16>(length);
46 u16 *dataMutable = mLookUpTable->getDataMutable();
47 mData = mLookUpTable->getData();
48 for (u16 x = 0; x < length; x++) {
49 dataMutable[x] = mapToIndex(x);
50 }
51 type = kLookUpTable;
52 xFunction = nullptr;
53}
54
55u16 XMap::mapToIndex(u16 x) const {
56 u16 index;

Callers 1

drawMethod · 0.45

Calls 3

getDataMutableMethod · 0.80
getDataMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected