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

Function traverseGridSegment

src/fl/math/traverse_grid.h:282–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280
281template <typename GridVisitor>
282inline void traverseGridSegment(const vec2f &start, const vec2f &end,
283 GridVisitor &visitor) {
284 float dx = fl::abs(end.x - start.x);
285 float dy = fl::abs(end.y - start.y);
286 float maxRange = fl::max(dx, dy);
287
288 // if (maxRange < 256.0f) {
289 // // Use Q8.8 (16-bit signed) if within ±127
290 // traverseGridSegment16(start, end, visitor);
291 // }
292 // else if (maxRange < 16777216.0f) {
293 // // Use Q24.8 (32-bit signed) if within ±8 million
294 // traverseGridSegment32(start, end, visitor);
295 // }
296 // else {
297 // // Fall back to floating-point
298 // traverseGridSegment(start, end, visitor);
299 // }
300
301 if (maxRange < 256.0f) {
302 // Use Q8.8 (16-bit signed) if within ±127
303 traverseGridSegment16(start, end, visitor);
304 } else {
305 // Use Q24.8 (32-bit signed) if within ±8 million
306 traverseGridSegment32(start, end, visitor);
307 }
308}
309
310} // namespace fl

Callers 1

traverse_grid.hppFile · 0.85

Calls 4

maxFunction · 0.85
traverseGridSegment16Function · 0.85
traverseGridSegment32Function · 0.85
absFunction · 0.70

Tested by

no test coverage detected