Struct jpeg_encoder::Encoder [−][src]
pub struct Encoder<W: Write> { /* fields omitted */ }
Expand description
Implementations
Create a new encoder with the given quality
The quality must be between 1 and 100 where 100 is the highest image quality.
By default, quality settings below 90 use a chroma subsampling (2x2 / 4:2:0) which can
be changed with set_sampling_factor
Set pixel density for the image
By default, this value is None which is equal to “1 pixel per pixel”.
Set chroma subsampling factor
Get chroma subsampling factor
pub fn set_quantization_tables(
&mut self,
luma: QuantizationTableType,
chroma: QuantizationTableType
)
pub fn set_quantization_tables(
&mut self,
luma: QuantizationTableType,
chroma: QuantizationTableType
)
Set quantization tables for luma and chroma components
Get configured quantization tables
Controls if progressive encoding is used.
By default, progressive encoding uses 4 scans.
Use set_progressive_scans to use a different number of scans
Set number of scans per component for progressive encoding
Number of scans must be between 2 and 64. There is at least one scan for the DC coefficients and one for the remaining 63 AC coefficients.
Panics
If number of scans is not within valid range
Return number of progressive scans if progressive encoding is enabled
Set restart interval
Set numbers of MCUs between restart markers.
Return the restart interval
Set if optimized huffman table should be created
Optimized tables result in slightly smaller file sizes but decrease encoding performance.
Returns if optimized huffman table should be generated
Appends a custom app segment to the JFIF file
Segment numbers need to be in the range between 1 and 15
The maximum allowed data length is 2^16 - 2 bytes.
Add an ICC profile
The maximum allowed data length is 16,707,345 bytes.
Encode an image
Data format and length must conform to specified width, height and color type.
Encode an image
Auto Trait Implementations
impl<W> RefUnwindSafe for Encoder<W> where
W: RefUnwindSafe,
impl<W> UnwindSafe for Encoder<W> where
W: UnwindSafe,