1
2
3
4
5
6
7
8
9
10
#[inline]
pub(crate) fn clamp(a: i32) -> i32 {
    if a < 0 {
        0
    } else if a > 255 {
        255
    } else {
        a
    }
}