Expand description
§image-atlas
This library provides a general-purpose texture atlas generator with a focus on ease of use and simplicity.
There are multiple generation methods and mip map options.
- No padding between elements
- With padding between elements
- With smart padding between elements for mip map generation.
This library uses image
crate for image processing and rectangle-pack
crate for computing element layout.
§Examples
use image_atlas::*;
let atlas = create_atlas(&AtlasDescriptor {
max_page_count: 8,
size: 2048,
mip: AtlasMipOption::MipWithBlock(AtlasMipFilter::Lanczos3, 32),
entries: &[AtlasEntry {
texture: image::RgbImage::new(512, 512),
mip: AtlasEntryMipOption::Clamp,
}],
})
.unwrap();
let texcoord = &atlas.texcoords[0];
let texture = &atlas.textures[texcoord.page as usize].mip_maps[0];
Structs§
- Atlas
- A result of texture atlas generation.
- Atlas
Descriptor - A texture atlas generation description.
- Atlas
Entry - A texture atlas generation entry description.
- Texcoord
- An element coordinate representing
u32
position. - Texcoord32
- An element coordinate representing
f32
position. - Texcoord64
- An element coordinate representing
f64
position. - Texture
- A output texture entry of texture atlas.
Enums§
- Atlas
Entry MipOption - A tiling method using by texture atlas generation.
- Atlas
Error - An error type for texture atlas generation.
- Atlas
MipFilter - A filter type using by mip map geration.
- Atlas
MipOption - A mip map method using by texture atlas generation.
Functions§
- create_
atlas - Creates a new texture atlas.