MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / saturate

Function saturate

external/basisu/transcoder/basisu_transcoder.cpp:217–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215 static inline int32_t clampi(int32_t value, int32_t low, int32_t high) { if (value < low) value = low; else if (value > high) value = high; return value; }
216 static inline float clampf(float value, float low, float high) { if (value < low) value = low; else if (value > high) value = high; return value; }
217 static inline float saturate(float value) { return clampf(value, 0, 1.0f); }
218
219 static inline uint8_t mul_8(uint32_t v, uint32_t q) { v = v * q + 128; return (uint8_t)((v + (v >> 8)) >> 8); }
220

Callers 2

vec4F_saturate_in_placeFunction · 0.70
vec4F_saturateFunction · 0.70

Calls 1

clampfFunction · 0.70

Tested by

no test coverage detected