Skip to content

Commit

Permalink
Merge pull request #1875 from Arvamer/avif_with_num_threads
Browse files Browse the repository at this point in the history
AvifEncoder: Add with_num_threads()
  • Loading branch information
fintelia committed May 14, 2023
2 parents 124ebc7 + 2b3bb51 commit c41c7d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/codecs/avif/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ impl<W: Write> AvifEncoder<W> {
.with_internal_color_space(color_space.to_ravif());
self
}

/// Configures `rayon` thread pool size.
/// The default `None` is to use all threads in the default `rayon` thread pool.
pub fn with_num_threads(mut self, num_threads: Option<usize>) -> Self {
self.encoder = self.encoder.with_num_threads(num_threads);
self
}
}

impl<W: Write> ImageEncoder for AvifEncoder<W> {
Expand Down

0 comments on commit c41c7d3

Please sign in to comment.