pub struct MultiAtlasManager { /* private fields */ }Expand description
Manages multiple texture atlases.
Implementations§
Source§impl MultiAtlasManager
impl MultiAtlasManager
Sourcepub fn new(config: AtlasConfig) -> Self
pub fn new(config: AtlasConfig) -> Self
Create a new multi-atlas manager with the given configuration.
Sourcepub fn config(&self) -> &AtlasConfig
pub fn config(&self) -> &AtlasConfig
Get the current configuration.
Sourcepub fn create_atlas(&mut self) -> Result<AtlasId, AtlasError>
pub fn create_atlas(&mut self) -> Result<AtlasId, AtlasError>
Create a new atlas and return its ID.
Sourcepub fn next_atlas_id(&self) -> u32
pub fn next_atlas_id(&self) -> u32
Get the next available atlas ID.
Sourcepub fn try_allocate(
&mut self,
width: u16,
height: u16,
) -> Result<AtlasAllocation, AtlasError>
pub fn try_allocate( &mut self, width: u16, height: u16, ) -> Result<AtlasAllocation, AtlasError>
Try to allocate space for an image with the given dimensions.
Sourcepub fn deallocate(
&mut self,
atlas_id: AtlasId,
alloc_id: AllocId,
width: u16,
height: u16,
) -> Result<(), AtlasError>
pub fn deallocate( &mut self, atlas_id: AtlasId, alloc_id: AllocId, width: u16, height: u16, ) -> Result<(), AtlasError>
Deallocate space in the specified atlas.
Sourcepub fn atlas_stats(&self) -> Vec<(AtlasId, &AtlasUsageStats)>
pub fn atlas_stats(&self) -> Vec<(AtlasId, &AtlasUsageStats)>
Get statistics for all atlases.
Sourcepub fn atlas_count(&self) -> usize
pub fn atlas_count(&self) -> usize
Get the number of atlases.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiAtlasManager
impl RefUnwindSafe for MultiAtlasManager
impl Send for MultiAtlasManager
impl Sync for MultiAtlasManager
impl Unpin for MultiAtlasManager
impl UnsafeUnpin for MultiAtlasManager
impl UnwindSafe for MultiAtlasManager
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