#[non_exhaustive]pub struct OwnedAnimationFrame { /* private fields */ }Expand description
A composited full-canvas animation frame with owned pixel data.
Produced by AnimationFrame::to_owned_frame() or
AnimationFrameDecoder::render_next_frame_owned().
Implementations§
Source§impl OwnedAnimationFrame
impl OwnedAnimationFrame
Sourcepub fn new(pixels: PixelBuffer, duration_ms: u32, frame_index: u32) -> Self
pub fn new(pixels: PixelBuffer, duration_ms: u32, frame_index: u32) -> Self
Create an owned frame from a PixelBuffer.
Sourcepub fn pixels(&self) -> PixelSlice<'_>
pub fn pixels(&self) -> PixelSlice<'_>
Borrow the pixel data as a PixelSlice.
Sourcepub fn into_buffer(self) -> PixelBuffer
pub fn into_buffer(self) -> PixelBuffer
Take the pixel buffer, consuming this frame.
Sourcepub fn duration_ms(&self) -> u32
pub fn duration_ms(&self) -> u32
Frame duration in milliseconds.
Sourcepub fn frame_index(&self) -> u32
pub fn frame_index(&self) -> u32
Displayed frame index (0-based).
Sourcepub fn as_animation_frame(&self) -> AnimationFrame<'_>
pub fn as_animation_frame(&self) -> AnimationFrame<'_>
Borrow as a AnimationFrame.
Sourcepub fn with_extras<T: Any + Send + Sync + 'static>(self, extras: T) -> Self
pub fn with_extras<T: Any + Send + Sync + 'static>(self, extras: T) -> Self
Attach a typed extension value (e.g., per-frame codec metadata).
Multiple independently-typed values can be stored.
Sourcepub fn extras<T: Any + Send + Sync + 'static>(&self) -> Option<&T>
pub fn extras<T: Any + Send + Sync + 'static>(&self) -> Option<&T>
Borrow a typed extension value if present.
Sourcepub fn take_extras<T: Any + Send + Sync + 'static>(&mut self) -> Option<T>
pub fn take_extras<T: Any + Send + Sync + 'static>(&mut self) -> Option<T>
Remove and return a typed extension value.
Returns Some(T) only when this is the sole Arc reference to the value.
Returns None if the type is not present or other references exist.
Sourcepub fn extensions(&self) -> &Extensions
pub fn extensions(&self) -> &Extensions
Access the full extension map.
Sourcepub fn extensions_mut(&mut self) -> &mut Extensions
pub fn extensions_mut(&mut self) -> &mut Extensions
Mutable access to the full extension map.