pub trait FFramesSyncedVideoFrame<'media> {
// Required methods
fn into_image(&self) -> ImageData<'media>;
fn into_resized_image(
&self,
options: &FrameConvertOptions,
) -> Option<ImageData<'media>>;
fn height(&self) -> u32;
fn width(&self) -> u32;
fn timestamp_seconds(&self) -> f32;
fn timestamp(&self) -> i64;
fn stream_fps(&self) -> f32;
fn stream_duration_in_seconds(&self) -> f32;
}Required Methods§
Sourcefn into_image(&self) -> ImageData<'media>
fn into_image(&self) -> ImageData<'media>
Gets the original image from the frame
This will perform color space conversion but will preserve the original frame
size. If you need to render the video frame in the smaller size, use into_resized_image.
This method take self to reuse frame data allocations, but you should not call this method more than once per the render function
Sourcefn into_resized_image(
&self,
options: &FrameConvertOptions,
) -> Option<ImageData<'media>>
fn into_resized_image( &self, options: &FrameConvertOptions, ) -> Option<ImageData<'media>>
Performs color space conversion and resizes the image to the specified size. Recommended to use this method if you render image in the smaller size than the original video e.g. as a pattern of some other shape or as a filler of standalone image.
This method take self to reuse frame data allocations, but you should not call this method more than once per the render function
Sourcefn timestamp_seconds(&self) -> f32
fn timestamp_seconds(&self) -> f32
Get the frame index of the origin video
Sourcefn stream_fps(&self) -> f32
fn stream_fps(&self) -> f32
Get the FPS of the origin video
Sourcefn stream_duration_in_seconds(&self) -> f32
fn stream_duration_in_seconds(&self) -> f32
Get the duration of the origin video in frames
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".