pub enum FrameFormat {
Rgb24,
Nv12,
Yuv420p,
Gray8,
Gray16,
BayerRggb8,
BayerRggb16,
}Expand description
Normalized pixel format of a frame in the ring. The engine downscales and converts the camera’s native format to one of these before publishing.
Variants§
Rgb24
Packed 24-bit RGB, 3 bytes per pixel.
Nv12
Semi-planar YUV 4:2:0 (Y plane then interleaved UV), 1.5 bytes per pixel.
Yuv420p
Planar YUV 4:2:0 (Y, then U, then V), 1.5 bytes per pixel.
Gray8
8-bit grayscale, 1 byte per pixel.
Gray16
16-bit grayscale, little-endian, 2 bytes per pixel.
BayerRggb8
8-bit Bayer mosaic, RGGB pattern, 1 byte per pixel.
BayerRggb16
16-bit Bayer mosaic, RGGB pattern, little-endian, 2 bytes per pixel.
Implementations§
Source§impl FrameFormat
impl FrameFormat
Sourcepub fn frame_bytes(self, width: u32, height: u32) -> usize
pub fn frame_bytes(self, width: u32, height: u32) -> usize
Exact byte length of one width x height frame in this format.
The 4:2:0 formats require even dimensions; callers normalize to even width/height before sizing a ring.
Sourcepub fn ffmpeg_pix_fmt(self) -> &'static str
pub fn ffmpeg_pix_fmt(self) -> &'static str
The ffmpeg -pix_fmt name of this layout.
Trait Implementations§
Source§impl Clone for FrameFormat
impl Clone for FrameFormat
impl Copy for FrameFormat
Source§impl Debug for FrameFormat
impl Debug for FrameFormat
Source§impl<'de> Deserialize<'de> for FrameFormat
impl<'de> Deserialize<'de> for FrameFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FrameFormat
Source§impl PartialEq for FrameFormat
impl PartialEq for FrameFormat
Source§impl Serialize for FrameFormat
impl Serialize for FrameFormat
impl StructuralPartialEq for FrameFormat
Auto Trait Implementations§
impl Freeze for FrameFormat
impl RefUnwindSafe for FrameFormat
impl Send for FrameFormat
impl Sync for FrameFormat
impl Unpin for FrameFormat
impl UnsafeUnpin for FrameFormat
impl UnwindSafe for FrameFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.