MCPcopy Create free account
hub / github.com/RustCV/RustCV / clamp

Function clamp

rustcv-camera/src/decode.rs:226–228  ·  view source on GitHub ↗
(val: i32)

Source from the content-addressed store, hash-verified

224/// 将 i32 钳位到 [0, 255] 范围并转换为 u8。
225#[inline(always)]
226fn clamp(val: i32) -> u8 {
227 val.clamp(0, 255) as u8
228}
229
230#[cfg(test)]
231mod tests {

Callers 1

yuyv_to_bgrFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected