| 10 | namespace fl { |
| 11 | |
| 12 | ScreenMap XYMap::toScreenMap() const { |
| 13 | const u16 length = width * height; |
| 14 | ScreenMap out(length); |
| 15 | for (u16 w = 0; w < width; w++) { |
| 16 | for (u16 h = 0; h < height; h++) { |
| 17 | u16 index = mapToIndex(w, h); |
| 18 | vec2f p = {static_cast<float>(w), static_cast<float>(h)}; |
| 19 | out.set(index, p); |
| 20 | } |
| 21 | } |
| 22 | // Store a shared_ptr to this XYMap so it can be used for encoding |
| 23 | out.setSourceXYMap(fl::make_shared<XYMap>(*this)); |
| 24 | return out; |
| 25 | } |
| 26 | |
| 27 | XYMap XYMap::constructWithUserFunction(u16 width, u16 height, |
| 28 | XYFunction xyFunction, u16 offset) { |
no test coverage detected