MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / clamp255

Function clamp255

example_transcoding/utils.h:49–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48inline int iabs(int i) { if (i < 0) i = -i; return i; }
49inline uint8_t clamp255(int32_t i) { return (uint8_t)((i & 0xFFFFFF00U) ? (~(i >> 31)) : i); }
50template <typename S> inline S clamp(S value, S low, S high) { return (value < low) ? low : ((value > high) ? high : value); }
51template<typename F> inline F lerp(F a, F b, F s) { return a + (b - a) * s; }
52template<typename F> inline F square(F a) { return a * a; }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected