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

Method at_no_wrap

src/fl/gfx/corkscrew.cpp.hpp:98–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97
98vec2f Corkscrew::at_no_wrap(fl::u16 i) const {
99 if (i >= mNumLeds) {
100 // Handle out-of-bounds access, possibly by returning a default value
101 return vec2f(0, 0);
102 }
103
104 // Compute position on-the-fly
105 vec2f position = calculateLedPositionExtended(i, mNumLeds, mTotalTurns,
106 mGapParams, mWidth, mHeight);
107
108 // // Apply inversion if requested
109 // if (mInvert) {
110 // fl::u16 invertedIndex = mNumLeds - 1 - i;
111 // position = calculateLedPositionExtended(invertedIndex, mNumLeds, mTotalTurns,
112 // mGapParams, mState.width, mState.height);
113 // }
114
115 // now wrap the x-position
116 //position.x = fl::fmodf(position.x, static_cast<float>(mState.width));
117
118 return position;
119}
120
121vec2f Corkscrew::at_exact(fl::u16 i) const {
122 // Get the unwrapped position

Callers 4

operator*Method · 0.80
FL_TEST_FILEFunction · 0.80
drawFunction · 0.80
loopFunction · 0.80

Calls 1

Tested by

no test coverage detected