Template Function clamp

Function Documentation

template<typename T>
static T clamp(T x, T min, T max)

Clamp a value to the range [min, max].

Parameters:
  • x – Value

  • min – Min value of the range [min, max]

  • max – Max value of the range [min, max]

Returns:

Value clamped to the range [min, max]