MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / clamp

Function clamp

Source/astcenc_mathlib.h:272–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270 */
271template<typename T>
272inline T clamp(T v, T mn, T mx)
273{
274 // Do not reorder; correct NaN handling relies on the fact that comparison
275 // with NaN returns false and will fall-through to the "min" value.
276 if (v > mx) return mx;
277 if (v > mn) return v;
278 return mn;
279}
280
281/**
282 * @brief Clamp a float value between 0.0f and 1.0f.

Callers 15

exp2Function · 0.70
clzFunction · 0.70
unorm16_to_sf16Function · 0.70
compress_blockFunction · 0.70
encode_texel_unormFunction · 0.70
validate_configFunction · 0.70
rgba_delta_unpackFunction · 0.70
hdr_rgb_unpackFunction · 0.70
hdr_alpha_unpackFunction · 0.70
clamp1fFunction · 0.70

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.40