pub trait FromRGBA: Send + Sync {
// Required methods
fn get_num_bytes(&self) -> RVec<usize>;
fn get_num_bytes_rgba(&self) -> usize;
fn get_total_bytes(&self) -> usize;
fn process_frame(
&self,
context: &ProcessFrameContext,
frame: VideoFrame,
) -> ConsumedVideoFrame;
fn copy_frame(
&self,
context: &FrameContext,
frame: ConsumedVideoFrame,
) -> RVec<RVec<u8>>;
}Expand description
Provides functions for consuming video frames from the GPU.
Required Methods§
Sourcefn get_num_bytes(&self) -> RVec<usize>
fn get_num_bytes(&self) -> RVec<usize>
Can be used to obtain the size of the copied frame.
Sourcefn get_num_bytes_rgba(&self) -> usize
fn get_num_bytes_rgba(&self) -> usize
Used internally by Phaneron to get the size of the frame on the GPU.
Sourcefn get_total_bytes(&self) -> usize
fn get_total_bytes(&self) -> usize
Used internally by Phaneron during the process of colour space conversion.
Sourcefn process_frame(
&self,
context: &ProcessFrameContext,
frame: VideoFrame,
) -> ConsumedVideoFrame
fn process_frame( &self, context: &ProcessFrameContext, frame: VideoFrame, ) -> ConsumedVideoFrame
Transforms a video frame into the described colour space / format.
Sourcefn copy_frame(
&self,
context: &FrameContext,
frame: ConsumedVideoFrame,
) -> RVec<RVec<u8>>
fn copy_frame( &self, context: &FrameContext, frame: ConsumedVideoFrame, ) -> RVec<RVec<u8>>
Copies a frame from the GPU.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".