MCPcopy Create free account
hub / github.com/FastLED/FastLED / s16x16>

Method s16x16>

src/fl/gfx/primitives.h:48–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46// Specialization for s16x16: uses from_raw, no float at all
47template<>
48inline fl::u8 coordToU8<fl::s16x16>(fl::s16x16 alpha) {
49 constexpr fl::s16x16 c255 = fl::s16x16::from_raw(255 * fl::s16x16::SCALE);
50 constexpr fl::s16x16 half = fl::s16x16::from_raw(1 << 15);
51 return (fl::u8)fl::clamp((alpha * c255 + half).to_int(), (fl::i32)0, (fl::i32)255);
52}
53
54/// Convert an integer to Coord without float intermediate.
55/// For s16x16: uses from_raw (pure integer shift). For float: implicit cast.

Callers

nothing calls this directly

Calls 3

clampFunction · 0.85
to_intMethod · 0.45
rawMethod · 0.45

Tested by

no test coverage detected