pub struct Painter(/* private fields */);Expand description
The raster’s raster::Painter, with its font atlas and images
decoded from PNG files, ready to render any number of frames (each
image is decoded once).
Implementations§
Source§impl Painter
impl Painter
Sourcepub fn new<'a>(
atlas: FontAtlasDef,
atlas_png: &[u8],
images: &ImageTable,
read: impl Fn(&str) -> Option<&'a [u8]>,
clear: Rgb,
) -> Result<Self, String>
pub fn new<'a>( atlas: FontAtlasDef, atlas_png: &[u8], images: &ImageTable, read: impl Fn(&str) -> Option<&'a [u8]>, clear: Rgb, ) -> Result<Self, String>
Decodes atlas image atlas_png and every image in images, whose
files read returns (an image read lacks, or that doesn’t decode,
draws as a MISSING_COLOR rectangle).
clear is the console background (the palette’s black).
Sourcepub fn render(&self, buf: &GlyphBuffer, scale: u32) -> Image
pub fn render(&self, buf: &GlyphBuffer, scale: u32) -> Image
Draws buf with each console pixel scale × scale pixels big
(raster::Painter::render).
Auto Trait Implementations§
impl Freeze for Painter
impl RefUnwindSafe for Painter
impl Send for Painter
impl Sync for Painter
impl Unpin for Painter
impl UnsafeUnpin for Painter
impl UnwindSafe for Painter
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