pub struct Atlas {
pub width: PhysicalPixels,
pub height: PhysicalPixels,
/* private fields */
}
Expand description
All of the rendered glyphs in a single atlas.
Fields§
§width: PhysicalPixels
A cached width of the atlas.
height: PhysicalPixels
A cached height of the atlas.
Implementations§
Source§impl Atlas
impl Atlas
Sourcepub fn new(
initial_width: PhysicalPixels,
initial_height: PhysicalPixels,
) -> Self
pub fn new( initial_width: PhysicalPixels, initial_height: PhysicalPixels, ) -> Self
Creates a new Atlas
with the specified width and height.
pub fn resize_pixels(&mut self, new_height: PhysicalPixels)
Sourcepub fn create_image(
&mut self,
width: PhysicalPixels,
height: PhysicalPixels,
) -> (PhysicalPixelsRect, PhysicalPixels, &mut Vec<u8>)
pub fn create_image( &mut self, width: PhysicalPixels, height: PhysicalPixels, ) -> (PhysicalPixelsRect, PhysicalPixels, &mut Vec<u8>)
Texture bounds (is not normalized), atlas width, and mutable pixel data.
Sourcepub fn pixels_mut_ref(&mut self) -> &mut [u8] ⓘ
pub fn pixels_mut_ref(&mut self) -> &mut [u8] ⓘ
Returns a reference to the pixel data of the atlas.
pub fn pixels(&self) -> Vec<u8> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Atlas
impl RefUnwindSafe for Atlas
impl Send for Atlas
impl Sync for Atlas
impl Unpin for Atlas
impl UnwindSafe for Atlas
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