Skip to content

Commit

Permalink
Fix incorrect documentation of AvifEncoder::new_with_speed_quality (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
astral4 authored Jan 14, 2024
1 parent 6a3f978 commit 778f185
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/codecs/avif/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ impl<W: Write> AvifEncoder<W> {
AvifEncoder::new_with_speed_quality(w, 4, 80) // `cavif` uses these defaults
}

/// Create a new encoder with specified speed and quality, that writes its output to `w`.
/// `speed` accepts a value in the range 0-10, where 0 is the slowest and 10 is the fastest.
/// `quality` accepts a value in the range 0-100, where 0 is the worst and 100 is the best.
/// Create a new encoder with a specified speed and quality that writes its output to `w`.
/// `speed` accepts a value in the range 1-10, where 1 is the slowest and 10 is the fastest.
/// Slower speeds generally yield better compression results.
/// `quality` accepts a value in the range 1-100, where 1 is the worst and 100 is the best.
pub fn new_with_speed_quality(w: W, speed: u8, quality: u8) -> Self {
// Clamp quality and speed to range
let quality = min(quality, 100);
Expand Down

0 comments on commit 778f185

Please sign in to comment.