| 58 | } |
| 59 | |
| 60 | XYMap XYMap::fromXMap(const XMap& xmap) { |
| 61 | // Create an XYMap with width=xmap.length and height=1 |
| 62 | // This treats the 1D strip as a 2D grid with height 1 |
| 63 | u16 length = xmap.getLength(); |
| 64 | |
| 65 | // Create a user function that dispatches to the XMap |
| 66 | // Since we can't capture xmap directly, we create a LUT and use that |
| 67 | auto out = XYMap::constructWithLookUpTable(length, 1, nullptr); |
| 68 | fl::shared_ptr<LUT16> lut = fl::make_shared<LUT16>(length); |
| 69 | u16* data = lut->getDataMutable(); |
| 70 | |
| 71 | // Fill the LUT with xmap's mappings |
| 72 | for (u16 i = 0; i < length; i++) { |
| 73 | data[i] = xmap.mapToIndex(i); |
| 74 | } |
| 75 | |
| 76 | out.mLookUpTable = lut; |
| 77 | return out; |
| 78 | } |
| 79 | |
| 80 | XYMap::XYMap(u16 width, u16 height, bool is_serpentine, |
| 81 | u16 offset) |
nothing calls this directly
no test coverage detected