pub struct CpuRenderer;Expand description
CPU Renderer implementation.
Implementations§
Source§impl CpuRenderer
impl CpuRenderer
Trait Implementations§
Source§impl Clone for CpuRenderer
impl Clone for CpuRenderer
Source§fn clone(&self) -> CpuRenderer
fn clone(&self) -> CpuRenderer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CpuRenderer
Source§impl Debug for CpuRenderer
impl Debug for CpuRenderer
Source§impl Default for CpuRenderer
impl Default for CpuRenderer
Source§fn default() -> CpuRenderer
fn default() -> CpuRenderer
Returns the “default value” for a type. Read more
Source§impl Renderer for CpuRenderer
impl Renderer for CpuRenderer
Source§fn render_frame(&self, atlas: &SpriteAtlas, frame_index: u32) -> Result<Vec<u8>>
fn render_frame(&self, atlas: &SpriteAtlas, frame_index: u32) -> Result<Vec<u8>>
Extracts frame
frame_index as frame_width * frame_height * 4
RGBA8 bytes.Source§fn compose(
&self,
layers: &[(&SpriteAtlas, u32, i32, i32)],
width: u32,
height: u32,
) -> Result<Vec<u8>>
fn compose( &self, layers: &[(&SpriteAtlas, u32, i32, i32)], width: u32, height: u32, ) -> Result<Vec<u8>>
Composites
layers — (atlas, frame_index, x, y) — onto a
transparent width×height canvas (src-over alpha blending),
returning width * height * 4 RGBA8 bytes. Layers are painted in
order (later = on top); out-of-canvas pixels are clipped.Auto Trait Implementations§
impl Freeze for CpuRenderer
impl RefUnwindSafe for CpuRenderer
impl Send for CpuRenderer
impl Sync for CpuRenderer
impl Unpin for CpuRenderer
impl UnsafeUnpin for CpuRenderer
impl UnwindSafe for CpuRenderer
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