pub struct Framebuffer { /* private fields */ }Implementations§
Source§impl Framebuffer
impl Framebuffer
Sourcepub fn to_png(&self) -> Vec<u8> ⓘ
pub fn to_png(&self) -> Vec<u8> ⓘ
RGBA PNG with original CRC/Adler and uncompressed DEFLATE blocks. This trades file size for a small dependency-free, browser-viewable export.
pub fn save_png(&self, path: impl AsRef<Path>) -> Result<(), Error>
pub fn save_ppm(&self, path: impl AsRef<Path>) -> Result<(), Error>
Source§impl Framebuffer
impl Framebuffer
pub fn new(width: u32, height: u32) -> Result<Framebuffer, RenderError>
pub const fn width(&self) -> u32
pub const fn height(&self) -> u32
Sourcepub fn pixels_mut(&mut self) -> &mut [[u8; 4]]
pub fn pixels_mut(&mut self) -> &mut [[u8; 4]]
Mutable color storage for 2D rasterizers; dimensions and depth storage remain fixed.
pub fn pixels(&self) -> &[[u8; 4]]
pub fn depths(&self) -> &[f32]
pub fn pixel(&self, x: u32, y: u32) -> Option<[u8; 4]>
pub fn clear(&mut self, color: Color)
Auto Trait Implementations§
impl Freeze for Framebuffer
impl RefUnwindSafe for Framebuffer
impl Send for Framebuffer
impl Sync for Framebuffer
impl Unpin for Framebuffer
impl UnwindSafe for Framebuffer
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