Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gossiperloturot/image-atlas
A texture atlas generator for general purpose
https://github.com/gossiperloturot/image-atlas
atlas-generator rust
Last synced: 3 months ago
JSON representation
A texture atlas generator for general purpose
- Host: GitHub
- URL: https://github.com/gossiperloturot/image-atlas
- Owner: GossiperLoturot
- License: apache-2.0
- Created: 2023-10-08T07:07:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-07T08:29:24.000Z (10 months ago)
- Last Synced: 2024-08-10T22:57:28.540Z (6 months ago)
- Topics: atlas-generator, rust
- Language: Rust
- Homepage:
- Size: 31.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# image-atlas
[![crates.io](https://img.shields.io/crates/v/image-atlas)](https://crates.io/crates/image-atlas)
[![doc.rs](https://img.shields.io/docsrs/image-atlas)](https://docs.rs/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
```rust
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];
```