FastLED 3.10.10
Loading...
Searching...
No Matches

◆ polyABClampPx()

fl::i32 fl::gfx::detail::polyABClampPx ( float px)
inline

Float -> Q16.16, clamped to ±8191 px.

NaN maps to 0 and out-of-range values saturate, so the float->int cast is always in range (an out-of-range or NaN cast is UB).

Definition at line 121 of file poly_abuffer.h.

121 {
122 if (!(px == px)) return 0; // NaN
123 if (px > 8191.0f) return polyABQ16Max;
124 if (px < -8191.0f) return -polyABQ16Max;
125 return static_cast<fl::i32>(px * 65536.0f);
126}
static const fl::i32 polyABQ16Max
Maximum |vertex coordinate| accepted, in Q16.16 units (8191 px keeps all values and edge deltas in i3...

References fl::FL_NO_EXCEPT, and polyABQ16Max.

Referenced by polyABToQ16(), and polyABToQ16< float >().

+ Here is the caller graph for this function: