Anyone knows below macro? I googled it but cant find anything useful. What does it do?
#define rt_SATURATE(sig,ll,ul) (((sig) >= (ul)) ? (ul) : (((sig) <= (ll)) ? (ll) : (sig)) )
It does what std::clamp does.
It "returns" sig
restricted to a range given by ll
(lower limit) and ul
(upper limit).
As the question is tagged with qt another alternative doing the same thing but with different order to the parameters is qBound