Struct guillotiere::SimpleAtlasAllocator
source · pub struct SimpleAtlasAllocator { /* private fields */ }
Expand description
A simpler atlas allocator implementation that can allocate rectangles but not deallocate them.
Implementations§
source§impl SimpleAtlasAllocator
impl SimpleAtlasAllocator
sourcepub fn with_options(size: Size, options: &AllocatorOptions) -> Self
pub fn with_options(size: Size, options: &AllocatorOptions) -> Self
Create a simple atlas allocator with the provided options.
sourcepub fn reset(&mut self, size: Size, options: &AllocatorOptions)
pub fn reset(&mut self, size: Size, options: &AllocatorOptions)
Clear the allocator and reset its size and options.
pub fn is_empty(&self) -> bool
sourcepub fn allocate(&mut self, requested_size: Size) -> Option<Rectangle>
pub fn allocate(&mut self, requested_size: Size) -> Option<Rectangle>
Allocate a rectangle in the atlas.
sourcepub fn grow(&mut self, new_size: Size)
pub fn grow(&mut self, new_size: Size)
Resize the atlas without changing the allocations.
This method is not allowed to shrink the width or height of the atlas.
sourcepub fn init_from_allocator(&mut self, src: &AtlasAllocator)
pub fn init_from_allocator(&mut self, src: &AtlasAllocator)
Initialize this simple allocator with the content of an atlas allocator.
Auto Trait Implementations§
impl RefUnwindSafe for SimpleAtlasAllocator
impl Send for SimpleAtlasAllocator
impl Sync for SimpleAtlasAllocator
impl Unpin for SimpleAtlasAllocator
impl UnwindSafe for SimpleAtlasAllocator
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