[][src]Struct etagere::AtlasAllocator

pub struct AtlasAllocator { /* fields omitted */ }

A shelf-packing dynamic texture atlas allocator tracking each allocation individually and with support for coalescing empty shelves.

Implementations

impl AtlasAllocator[src]

pub fn with_options(size: Size, options: &AllocatorOptions) -> Self[src]

Create an atlas allocator with provided options.

pub fn new(size: Size) -> Self[src]

Create an atlas allocator with default options.

pub fn clear(&mut self)[src]

pub fn size(&self) -> Size[src]

pub fn allocate(&mut self, size: Size) -> Option<Allocation>[src]

Allocate a rectangle in the atlas.

pub fn deallocate(&mut self, id: AllocId)[src]

Deallocate a rectangle in the atlas.

pub fn is_empty(&self) -> bool[src]

pub fn dump_svg(&self, output: &mut dyn Write) -> Result<()>[src]

Dump a visual representation of the atlas in SVG format.

pub fn dump_into_svg(
    &self,
    rect: Option<&Rectangle>,
    output: &mut dyn Write
) -> Result<()>
[src]

Dump a visual representation of the atlas in SVG, omitting the beginning and end of the SVG document, so that it can be included in a larger document.

If a rectangle is provided, translate and scale the output to fit it.

Trait Implementations

impl Clone for AtlasAllocator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.