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

Method to_fourcc

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

Convert back to a V4L2 FourCC `u32`. 转换回 V4L2 FourCC `u32`。

(self)

Source from the content-addressed store, hash-verified

110 /// Convert back to a V4L2 FourCC `u32`.
111 /// 转换回 V4L2 FourCC `u32`。
112 pub fn to_fourcc(self) -> u32 {
113 match self {
114 Self::Mjpeg => fcc::MJPEG,
115 Self::Yuyv => fcc::YUYV,
116 Self::Nv12 => fcc::NV12,
117 Self::Bgr24 => fcc::BGR24,
118 Self::Rgb24 => fcc::RGB24,
119 Self::Bgra32 => fcc::BGRA32,
120 Self::Other(v) => v,
121 }
122 }
123
124 /// Returns a human-readable FourCC string (e.g., "MJPG").
125 /// 返回人类可读的 FourCC 字符串(如 "MJPG")。

Callers 2

fourcc_strMethod · 0.80
negotiate_formatMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected