MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / get_pixel_format

Method get_pixel_format

flow-plugins/src/utils/frame.rs:74–95  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

72
73 #[getter(pixel_format)]
74 fn get_pixel_format(&self) -> &str {
75 let fmt = self.inner.fmt;
76 if fmt == mgc::PixelFormat::YUV420P {
77 "yuv420p"
78 } else if fmt == mgc::PixelFormat::NV12 {
79 "nv12"
80 } else if fmt == mgc::PixelFormat::NV21 {
81 "nv21"
82 } else if fmt == mgc::PixelFormat::YUVJ420P {
83 "yuvj420p"
84 } else if fmt == mgc::PixelFormat::BGR24_PACKED {
85 "bgr24_packed"
86 } else if fmt == mgc::PixelFormat::BGR24_PLANAR {
87 "bgr24_planar"
88 } else if fmt == mgc::PixelFormat::RGB24_PACKED {
89 "rgb24_packed"
90 } else if fmt == mgc::PixelFormat::RGB24_PLANAR {
91 "rgb24_planar"
92 } else {
93 "unknow"
94 }
95 }
96}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected