wgame_image/lib.rs
1//! CPU images, slices, pixel types, and append-only atlas generations.
2//!
3//! [`Image`] owns pixels; [`ImageSlice`] and [`ImageSliceMut`] provide borrowed views.
4//! [`Atlas`] shares storage between [`AtlasImage`] handles; see its allocation and
5//! relocation contracts before integrating a GPU mirror.
6//!
7//! The default `png` feature enables PNG decoding and encoding. Pixel values are
8//! passed through without automatic sRGB-to-linear conversion. [`euclid`] is
9//! re-exported for rectangle and size arguments.
10
11#![forbid(unsafe_code)]
12
13pub mod atlas;
14/// Geometry types used by image and atlas APIs.
15pub use euclid;
16#[cfg(feature = "image")]
17mod endec;
18mod image;
19mod pixel;
20mod slice;
21#[cfg(test)]
22mod tests;
23mod traits;
24
25pub use crate::{
26 atlas::{Atlas, AtlasImage},
27 image::Image,
28 pixel::Pixel,
29 slice::{ImageSlice, ImageSliceMut},
30 traits::*,
31};
32#[cfg(feature = "image")]
33pub use endec::Encoding;
34
35/// Commonly used traits.
36pub mod prelude {
37 #[doc(no_inline)]
38 pub use crate::traits::*;
39}