pub struct FrameHeader {
pub pixel_format: PixelFormat,
pub width: u32,
pub height: u32,
pub seq: u32,
pub row_stride: Option<u32>,
pub metadata: Option<FrameMetadata>,
}Expand description
Geometry and optional metadata for the pixels that follow it.
Fields§
§pixel_format: PixelFormatPFNC format projected onto the wire’s byte code.
width: u32Image width in pixels.
height: u32Image height in pixels.
seq: u32Service image sequence, wrapping at u32::MAX.
row_stride: Option<u32>Bytes per padded row; None means continuous packing.
metadata: Option<FrameMetadata>Facts from this exact frame, inline rather than separately published.
Implementations§
Source§impl FrameHeader
impl FrameHeader
Sourcepub fn encode(&self) -> Result<Vec<u8>, FrameHeaderError>
pub fn encode(&self) -> Result<Vec<u8>, FrameHeaderError>
Encode the prefix and bounded metadata. Append the pixels afterward.
Sourcepub fn decode(buf: &[u8]) -> Result<(FrameHeader, &[u8]), FrameHeaderError>
pub fn decode(buf: &[u8]) -> Result<(FrameHeader, &[u8]), FrameHeaderError>
Decode bounded metadata before exposing the remaining image bytes. Older envelope versions are rejected, never read with guessed offsets.
Trait Implementations§
Source§impl Clone for FrameHeader
impl Clone for FrameHeader
Source§impl Debug for FrameHeader
impl Debug for FrameHeader
impl Eq for FrameHeader
Source§impl PartialEq for FrameHeader
impl PartialEq for FrameHeader
impl StructuralPartialEq for FrameHeader
Auto Trait Implementations§
impl Freeze for FrameHeader
impl RefUnwindSafe for FrameHeader
impl Send for FrameHeader
impl Sync for FrameHeader
impl Unpin for FrameHeader
impl UnsafeUnpin for FrameHeader
impl UnwindSafe for FrameHeader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.