pub struct JpegTranscodeConfig {
pub jpeg_reconstruction: bool,
pub num_threads: usize,
pub brotli_compression: Option<Box<dyn BrotliCompression>>,
pub speed: Speed,
}Expand description
Options for encode_jpeg_lossless_with_config.
Fields§
§jpeg_reconstruction: boolWhether to embed the data needed to rebuild the original JPEG bytes.
Defaults to true. See Self::with_jpeg_reconstruction.
num_threads: usizeWorker threads used while building the codestream. Defaults to 1.
brotli_compression: Option<Box<dyn BrotliCompression>>Optional Brotli implementation for JPEG reconstruction data and the Exif and XMP boxes.
When absent, Jixel uses its own small Brotli encoder, so no Brotli dependency is needed; a stronger one can be supplied here.
speed: SpeedEntropy-coding effort. The coefficients, and so the decoded pixels and
the reconstructed JPEG, are the same at every speed. Defaults to
Speed::Fast.
Speed::Slow and Speed::ExtraSlow also try a learned DC context
tree, retaining it only when the complete codestream is smaller.
Implementations§
Source§impl JpegTranscodeConfig
impl JpegTranscodeConfig
Sourcepub fn with_jpeg_reconstruction(self, enabled: bool) -> Self
pub fn with_jpeg_reconstruction(self, enabled: bool) -> Self
Controls whether the original JPEG bytes can be recovered.
Sourcepub fn with_num_threads(self, threads: usize) -> Self
pub fn with_num_threads(self, threads: usize) -> Self
Sets the number of worker threads, which does not affect the output.
Sourcepub fn with_speed(self, speed: Speed) -> Self
pub fn with_speed(self, speed: Speed) -> Self
Sets the entropy-coding effort; see Self::speed.
Sourcepub fn with_brotli_compression(
self,
compressor: Box<dyn BrotliCompression>,
) -> Self
pub fn with_brotli_compression( self, compressor: Box<dyn BrotliCompression>, ) -> Self
Uses a caller-provided Brotli encoder for JPEG reconstruction data and metadata boxes.