Document Compression enum variants

This commit is contained in:
Sergey "Shnatsel" Davidoff committed 2026-03-06 14:47:44 +00:00
1 parent ba97bad411
commit a03eeccfe5
1 file changed
+10
+10
View File
@@ -42,12 +42,22 @@ pub type Predictor = crate::tags::Predictor;
#[non_exhaustive] #[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Default)] #[derive(Debug, Clone, Copy, PartialEq, Default)]
pub enum Compression { pub enum Compression {
/// No compression whatsoever. Fastest but produces large files.
#[default] #[default]
Uncompressed, Uncompressed,
/// Legacy [LZW](https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch) algorithm. Not recommended, use DEFLATE instead.
#[cfg(feature = "lzw")] #[cfg(feature = "lzw")]
Lzw, Lzw,
/// [DEFLATE](https://en.wikipedia.org/wiki/DEFLATE) algorithm with the specified compression level.
///
/// The valid levels are 1 through 9 inclusive. The default level is 6.
///
/// - `1` stands for light but fast compression
/// - `6` is the recommended balanced default
/// - `9` is maximum compression ratio at the cost of slow encoding
#[cfg(feature = "deflate")] #[cfg(feature = "deflate")]
Deflate(u8), Deflate(u8),
/// [PackBits](https://en.wikipedia.org/wiki/PackBits) compression, a variant of RLE compression scheme. Fast, primitive compression with a poor compression ratio.
Packbits, Packbits,
} }