|
1 | 1 | //! Implementations of [`ReadFrom`] and [`WriteTo`] for image files. |
| 2 | +//! |
| 3 | +//! The [`image`] crate is used for image decoding and encoding. |
| 4 | +//! |
| 5 | +//! Main wrapper type is the [`Img`] struct, which is generic over an image format. |
| 6 | +//! Specific image formats are provided as zero-sized types implementing the [`ImgFormat`] trait. |
| 7 | +//! |
| 8 | +//! The following image formats are supported, behind feature flags: |
| 9 | +//! |
| 10 | +//! - PNG (`image-format-png`) |
| 11 | +//! - JPEG (`image-format-jpeg`) |
| 12 | +//! - GIF (`image-format-gif`) |
| 13 | +//! - WebP (`image-format-webp`) |
| 14 | +//! - PNM (`image-format-pnm`) |
| 15 | +//! - TIFF (`image-format-tiff`) |
| 16 | +//! - TGA (`image-format-tga`) |
| 17 | +//! - BMP (`image-format-bmp`) |
| 18 | +//! - ICO (`image-format-ico`) |
| 19 | +//! - HDR (`image-format-hdr`) |
| 20 | +//! - OpenEXR (`image-format-exr`) |
| 21 | +//! - Farbfeld (`image-format-ff`) |
| 22 | +//! - AVIF (`image-format-avif`) |
| 23 | +//! - QOI (`image-format-qoi`) |
| 24 | +//! |
| 25 | +//! For an async VFS implementation to support reading and writing images using these types, |
| 26 | +//! the following impls are required for the VFS type: |
| 27 | +//! |
| 28 | +//! - `impl<T: ImgFormat> ReadImageFromAsync<T> for NewVfsType` |
| 29 | +//! - `impl<'a> WriteImageToAsync<'a> for NewVfsType` |
| 30 | +//! - `impl<'a> WriteImageToAsyncRef<'a> for NewVfsType` |
2 | 31 |
|
3 | 32 | #[cfg(all( |
4 | 33 | feature = "assert_eq", |
|
0 commit comments