pub struct Frame { /* private fields */ }Expand description
A rendered image, four bytes per pixel (red, green, blue, alpha), row by row from the top.
The fields are private so the byte length always matches the size.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn new(
rgba: Vec<u8>,
size: Physical<Size<u32>>,
scale: ScaleFactor,
) -> Result<Frame, FrameError>
pub fn new( rgba: Vec<u8>, size: Physical<Size<u32>>, scale: ScaleFactor, ) -> Result<Frame, FrameError>
A frame from its pixels. Fails unless rgba holds exactly width * height * 4 bytes.
Sourcepub fn logical_size(&self) -> Logical<Size<f32>>
pub fn logical_size(&self) -> Logical<Size<f32>>
The size in logical pixels.
Sourcepub fn scale(&self) -> ScaleFactor
pub fn scale(&self) -> ScaleFactor
The scale factor the frame was rendered at.
Trait Implementations§
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl Forget for Frame
impl Freeze for Frame
impl Move for Frame
impl RefUnwindSafe for Frame
impl Send for Framewhere
RawVecInner: Send,
impl Sync for Framewhere
RawVecInner: Sync,
impl Unpin for Frame
impl UnsafeUnpin for Frame
impl UnwindSafe for Framewhere
RawVecInner: 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