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

Method fourcc_str

rustcv-camera/src/pixel_format.rs:126–135  ·  view source on GitHub ↗

Returns a human-readable FourCC string (e.g., "MJPG"). 返回人类可读的 FourCC 字符串(如 "MJPG")。

(self)

Source from the content-addressed store, hash-verified

124 /// Returns a human-readable FourCC string (e.g., "MJPG").
125 /// 返回人类可读的 FourCC 字符串(如 "MJPG")。
126 pub fn fourcc_str(self) -> String {
127 let v = self.to_fourcc();
128 let bytes = [
129 (v & 0xFF) as u8,
130 ((v >> 8) & 0xFF) as u8,
131 ((v >> 16) & 0xFF) as u8,
132 ((v >> 24) & 0xFF) as u8,
133 ];
134 String::from_utf8_lossy(&bytes).into_owned()
135 }
136}
137
138impl std::fmt::Display for PixelFormat {

Callers

nothing calls this directly

Calls 1

to_fourccMethod · 0.80

Tested by

no test coverage detected