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

Method from_fourcc

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

Convert a V4L2 FourCC `u32` to a [`PixelFormat`]. 将 V4L2 FourCC `u32` 转换为 [`PixelFormat`]。

(fourcc: u32)

Source from the content-addressed store, hash-verified

96 /// Convert a V4L2 FourCC `u32` to a [`PixelFormat`].
97 /// 将 V4L2 FourCC `u32` 转换为 [`PixelFormat`]。
98 pub fn from_fourcc(fourcc: u32) -> Self {
99 match fourcc {
100 fcc::MJPEG => Self::Mjpeg,
101 fcc::YUYV => Self::Yuyv,
102 fcc::NV12 => Self::Nv12,
103 fcc::BGR24 => Self::Bgr24,
104 fcc::RGB24 => Self::Rgb24,
105 fcc::BGRA32 => Self::Bgra32,
106 other => Self::Other(other),
107 }
108 }
109
110 /// Convert back to a V4L2 FourCC `u32`.
111 /// 转换回 V4L2 FourCC `u32`。

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected