Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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)]
226
fn clamp(val: i32) -> u8 {
227
val.clamp(0, 255) as u8
228
}
229
230
#[cfg(test)]
231
mod tests {
Callers
1
yuyv_to_bgr
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected