Struct atlas::Atlas [] [src]

pub struct Atlas<T> { /* fields omitted */ }

Stores images, and automatically stitches them together.

While it's definitely okay to add the images in any order, to get any decent space efficiency it's necessary to at least sort-of sort the frames in terms of decreasing size. Particularly good orders are by width * height and by max(width, height), both in descending order.

Methods

impl<T> Atlas<T>
[src]

Create a new, empty atlas.

The blank pixel will be used to represent the space that exists between images, in the almost certain case that 100% space utilization is not achieved.

Adds an image to the atlas, placing it appropriately.

The return value is the location of the image within the atlas. If the image is of zero size, then the coordinates (0, 0) will be returned, which you most likely won't need to special-case, since it is technically valid.

Trait Implementations

impl<T> Into<Chunky<T>> for Atlas<T> where
    T: AsBytes
[src]

Performs the conversion.

impl<T> Image for Atlas<T> where
    T: AsBytes
[src]

The kind of pixel that the frame is made of.

The width of the frame in pixels.

The height of the frame in pixels.

Gets the pixel at the specified zero-indexed coordinates. Read more