pub struct Atlas {
pub id: AtlasId,
allocator: AtlasAllocator,
stats: AtlasUsageStats,
allocation_counter: u32,
}Expand description
Represents a single atlas in the multi-atlas system.
Fields§
§id: AtlasIdUnique identifier for this atlas.
allocator: AtlasAllocatorRectangle allocator backend.
stats: AtlasUsageStatsCurrent usage statistics.
allocation_counter: u32Allocation counter.
Implementations§
Source§impl Atlas
impl Atlas
Sourcepub fn new(id: AtlasId, width: u32, height: u32) -> Self
pub fn new(id: AtlasId, width: u32, height: u32) -> Self
Create a new atlas with the given ID and size.
Sourcepub fn allocate(&mut self, width: u32, height: u32) -> Option<Allocation>
pub fn allocate(&mut self, width: u32, height: u32) -> Option<Allocation>
Try to allocate an image in this atlas.
Sourcepub fn deallocate(&mut self, alloc_id: AllocId, width: u32, height: u32)
pub fn deallocate(&mut self, alloc_id: AllocId, width: u32, height: u32)
Deallocate an image from this atlas.
Sourcepub fn stats(&self) -> &AtlasUsageStats
pub fn stats(&self) -> &AtlasUsageStats
Get current usage statistics.
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 UnsafeUnpin 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