| 1 | //! Decoding and Encoding of TIFF Images |
| 2 | //! |
| 3 | //! TIFF (Tagged Image File Format) is a versatile image format that supports |
| 4 | //! lossless and lossy compression. |
| 5 | //! |
| 6 | //! # Related Links |
| 7 | //! * <https://web.archive.org/web/20210108073850/https://www.adobe.io/open/standards/TIFF.html> - The TIFF specification |
| 8 | |
| 9 | extern crate jpeg; |
| 10 | extern crate weezl; |
| 11 | |
| 12 | mod bytecast; |
| 13 | pub mod decoder; |
| 14 | pub mod encoder; |
| 15 | mod error; |
| 16 | pub mod tags; |
| 17 | |
| 18 | pub use self::error::{TiffError, TiffFormatError, TiffResult, TiffUnsupportedError, UsageError}; |
| 19 | |
| 20 | /// An enumeration over supported color types and their bit depths |
| 21 | #[derive (Copy, PartialEq, Eq, Debug, Clone, Hash)] |
| 22 | pub enum ColorType { |
| 23 | /// Pixel is grayscale |
| 24 | Gray(u8), |
| 25 | |
| 26 | /// Pixel contains R, G and B channels |
| 27 | RGB(u8), |
| 28 | |
| 29 | /// Pixel is an index into a color palette |
| 30 | Palette(u8), |
| 31 | |
| 32 | /// Pixel is grayscale with an alpha channel |
| 33 | GrayA(u8), |
| 34 | |
| 35 | /// Pixel is RGB with an alpha channel |
| 36 | RGBA(u8), |
| 37 | |
| 38 | /// Pixel is CMYK |
| 39 | CMYK(u8), |
| 40 | |
| 41 | /// Pixel is YCbCr |
| 42 | YCbCr(u8), |
| 43 | } |
| 44 | |