pub struct Frame<B: Backend> {
pub image: Image<B>,
pub pts: Duration,
pub duration: Duration,
pub index: usize,
pub is_keyframe: bool,
}Expand description
A single video frame with timing metadata.
Wraps an Image with presentation timestamp and duration information
for proper video playback and editing workflows.
Fields§
§image: Image<B>The image data for this frame (C, H, W tensor).
pts: DurationPresentation timestamp — when this frame should be displayed.
duration: DurationHow long this frame should be displayed (used for variable frame rate).
index: usizeFrame index in the sequence (0-based).
is_keyframe: boolWhether this frame is a keyframe (I-frame).
Implementations§
Source§impl<B: Backend> Frame<B>
impl<B: Backend> Frame<B>
Sourcepub fn new(image: Image<B>, pts: Duration, index: usize) -> Self
pub fn new(image: Image<B>, pts: Duration, index: usize) -> Self
Creates a new frame with the given image and timestamp.
Sourcepub fn keyframe(image: Image<B>, pts: Duration, index: usize) -> Self
pub fn keyframe(image: Image<B>, pts: Duration, index: usize) -> Self
Creates a keyframe (I-frame) at the given timestamp.
Sourcepub fn with_duration(self, duration: Duration) -> Self
pub fn with_duration(self, duration: Duration) -> Self
Sets the display duration for this frame (for variable frame rate).
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Frame<B>where
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for Frame<B>where
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for Frame<B>
impl<B> Sync for Frame<B>
impl<B> Unpin for Frame<B>where
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B> UnsafeUnpin for Frame<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::QuantizedTensorPrimitive: UnsafeUnpin,
impl<B> UnwindSafe for Frame<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: UnwindSafe,
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<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more