pub struct GlyphAtlas {
pub allocator: BucketedAtlasAllocator,
pub pixels: Vec<u8>,
pub width: u32,
pub height: u32,
pub dirty: bool,
}Fields§
§allocator: BucketedAtlasAllocator§pixels: Vec<u8>§width: u32§height: u32§dirty: boolImplementations§
Source§impl GlyphAtlas
impl GlyphAtlas
pub fn new() -> Self
Sourcepub fn allocate(&mut self, width: u32, height: u32) -> Option<Allocation>
pub fn allocate(&mut self, width: u32, height: u32) -> Option<Allocation>
Allocate a region for a glyph of width×height pixels. The
returned allocation reserves a 1-pixel gutter on the right and
bottom so adjacent glyphs can’t bleed into each other under
float-precision UV rounding. Callers still blit only the
requested width×height pixels at rect.min; the extra
column/row of transparent pixels is the safety margin.
pub fn deallocate(&mut self, id: AllocId)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GlyphAtlas
impl RefUnwindSafe for GlyphAtlas
impl Send for GlyphAtlas
impl Sync for GlyphAtlas
impl Unpin for GlyphAtlas
impl UnsafeUnpin for GlyphAtlas
impl UnwindSafe for GlyphAtlas
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