pub struct Frame { /* private fields */ }Expand description
Immutable ref-counted frame handle.
Implementations§
Source§impl Frame
impl Frame
Sourcepub const fn format(&self) -> &FormatDescriptor
pub const fn format(&self) -> &FormatDescriptor
Returns frame format descriptor.
Sourcepub const fn actual_alignment(&self) -> usize
pub const fn actual_alignment(&self) -> usize
Returns actual alignment used for this frame allocation.
Sourcepub fn plane<T>(&self, index: usize) -> Result<Plane<T>, PixelFlowError>where
T: Sample,
pub fn plane<T>(&self, index: usize) -> Result<Plane<T>, PixelFlowError>where
T: Sample,
Returns typed immutable plane view.
Sourcepub fn with_metadata(&self, metadata: Metadata) -> Frame
pub fn with_metadata(&self, metadata: Metadata) -> Frame
Creates frame clone that shares all plane buffers and replaces metadata.
Returns true when both frames share same backing storage for a plane index.
Returns true when selected planes share the same backing storage.
Sourcepub fn view(
&self,
left: usize,
top: usize,
width: usize,
height: usize,
) -> Result<Frame, PixelFlowError>
pub fn view( &self, left: usize, top: usize, width: usize, height: usize, ) -> Result<Frame, PixelFlowError>
Creates zero-copy crop-like view over parent plane storage.
Sourcepub fn single_plane_view(
&self,
plane_index: usize,
format: FormatDescriptor,
) -> Result<Frame, PixelFlowError>
pub fn single_plane_view( &self, plane_index: usize, format: FormatDescriptor, ) -> Result<Frame, PixelFlowError>
Creates a zero-copy frame containing one source plane as plane 0 of format.
Sourcepub fn from_plane_sources(
format: FormatDescriptor,
width: usize,
height: usize,
sources: &[(&Frame, usize)],
metadata: Metadata,
) -> Result<Frame, PixelFlowError>
pub fn from_plane_sources( format: FormatDescriptor, width: usize, height: usize, sources: &[(&Frame, usize)], metadata: Metadata, ) -> Result<Frame, PixelFlowError>
Creates a zero-copy frame from existing plane storage.
Sourcepub unsafe fn raw_plane(&self, index: usize) -> Result<RawPlane, PixelFlowError>
pub unsafe fn raw_plane(&self, index: usize) -> Result<RawPlane, PixelFlowError>
Returns raw pointer and stride view for expert Rust and ABI adapters.
§Safety
Caller must honor plane bounds from height and stride_bytes, and must interpret sample
values using returned sample_type. Pointer remains valid only while frame storage remains
alive through this frame or another shared owner.