flow_texpack/lib.rs
1// flow-texpack: A program that will allow you to generate texture atlas.
2// zlib License (see LICENSE)
3
4//! `flow-texpack` is a program that will allow you to generate texture atlas from input images (BMP,
5//! HDR, JPG, PNG, TGA, TIFF, WEBP). The application generates both texture atlas and descriptions
6//! file that can be read by a game.
7//!
8//! ## Usage
9//! Show available options:
10//! ```sh
11//! flow-texpack -h
12//! ```
13//!
14//! or
15//!
16//! ```sh
17//! flow-texpack --help
18//! ```
19//!
20//! ## Examples
21//!
22//! Generate from input `data/characters` and `data/tiles`, write output to `out/atlas` and enable
23//! the options: `premultiply` pixels by their alpha channel, `trim` excess transparency off the
24//! textures, `remove duplicate textures` from the atlas, enable `rotation` of textures 90 degrees
25//! clockwise, `pad` each texture by 2 pixels and finally enable `verbose` output mode.
26//!
27//! ```sh
28//! flow-texpack -i data/characters data/tiles -o out/atlas -m -t -u -r -p 2 -v
29//! ```
30//!
31//! Enable `load filter` so that only `TGA` images are included in the texture atlas:
32//!
33//! ```sh
34//! flow-texpack -i data/tiles -o out/atlas --load-filter tga -v
35//! ```
36//!
37//! Enable rect heuristic `AreaFit`:
38//!
39//! ```sh
40//! flow-texpack -i data/tiles -o out/atlas --rect-heuristic area-fit -v
41//! ```
42//!
43//! Enable output `atlas size` of **2048x2048**:
44//!
45//! ```sh
46//! flow-texpack -i data/tiles -o out/atlas --atlas-size pot2048 -v
47//! ```
48//!
49//! Read input files/directories from `input.txt` but exclude all in `exclude.txt`:
50//!
51//! ```sh
52//! flow-texpack --input-file input.txt --exlude-file exclude.txt -o out/atlas -v
53//! ```
54//!
55//! `Adjust atlas size` automatically so that texture will fit:
56//!
57//! ```sh
58//! flow-texpack -i data/characters -o out/atlas --adjust-size -v
59//! ```
60//!
61//! `Adjust texture size` so that it will fit given atlas size:
62//!
63//! ```sh
64//! flow-texpack -i data/characters -o out/atlas --adjust-fit -v
65//! ```
66
67#[doc(hidden)]
68pub mod texpack;
69
70// re-export types:
71#[doc(hidden)]
72pub use crate::texpack::app::App;
73
74#[doc(hidden)]
75pub use crate::texpack::app::get_atlas_image_extension;
76
77#[doc(hidden)]
78pub use crate::texpack::app::create_dir_all;
79
80#[doc(hidden)]
81pub use crate::texpack::app::remove_dir_all;
82
83#[doc(hidden)]
84pub use crate::texpack::app::remove_file;
85
86#[doc(hidden)]
87pub use crate::texpack::app::exists_dir;
88
89#[doc(hidden)]
90pub use crate::texpack::app::exists_file;
91
92#[doc(hidden)]
93pub use crate::texpack::app::write_file_sync;
94
95#[doc(hidden)]
96pub use crate::texpack::packer::Packer;
97
98#[doc(hidden)]
99pub use crate::texpack::packer::PackerError;
100
101#[doc(hidden)]
102pub use crate::texpack::texture::Texture;
103
104#[doc(hidden)]
105pub use crate::texpack::texture::TextureError;