pub struct ScanlineDecoder<'a> { /* private fields */ }Expand description
Row-by-row JPEG decoder.
Implementations§
Source§impl<'a> ScanlineDecoder<'a>
impl<'a> ScanlineDecoder<'a>
Sourcepub fn header(&self) -> &FrameHeader
pub fn header(&self) -> &FrameHeader
Returns the JPEG frame header.
Sourcepub fn output_scanline(&self) -> usize
pub fn output_scanline(&self) -> usize
Returns the number of scanlines read so far.
Sourcepub fn set_output_format(&mut self, format: PixelFormat)
pub fn set_output_format(&mut self, format: PixelFormat)
Set the output pixel format before starting decode.
Sourcepub fn set_fast_upsample(&mut self, fast: bool)
pub fn set_fast_upsample(&mut self, fast: bool)
Enable or disable fast (nearest-neighbor) upsampling.
Sourcepub fn set_fast_dct(&mut self, fast: bool)
pub fn set_fast_dct(&mut self, fast: bool)
Enable or disable fast DCT for decoding.
Sourcepub fn set_dct_method(&mut self, method: DctMethod)
pub fn set_dct_method(&mut self, method: DctMethod)
Set the DCT/IDCT method for decoding.
Sourcepub fn set_block_smoothing(&mut self, smooth: bool)
pub fn set_block_smoothing(&mut self, smooth: bool)
Enable or disable inter-block smoothing.
Sourcepub fn set_output_colorspace(&mut self, cs: ColorSpace)
pub fn set_output_colorspace(&mut self, cs: ColorSpace)
Override the output color space.
Sourcepub fn set_merged_upsample(&mut self, enabled: bool)
pub fn set_merged_upsample(&mut self, enabled: bool)
Enable merged upsampling optimization (combines upsample + color convert).
When enabled and subsampling is 4:2:0 or 4:2:2, uses a merged path that avoids intermediate chroma buffers. Faster but uses box-filter replication instead of fancy triangle-filter upsampling.
Sourcepub fn set_crop_x(&mut self, x: usize, width: usize)
pub fn set_crop_x(&mut self, x: usize, width: usize)
Set horizontal crop region for scanline-level decoding.
Sourcepub fn set_bottom_up(&mut self, bottom_up: bool)
pub fn set_bottom_up(&mut self, bottom_up: bool)
Enable or disable bottom-up row order.
When true, the output rows are reversed after decompression so that
row 0 of the output corresponds to the last row of the image.
Matches libjpeg-turbo’s TJPARAM_BOTTOMUP on the decode side.
Sourcepub fn read_scanline(&mut self, buf: &mut [u8]) -> Result<()>
pub fn read_scanline(&mut self, buf: &mut [u8]) -> Result<()>
Decode and copy one scanline into buf.
Sourcepub fn skip_scanlines(&mut self, count: usize) -> Result<usize>
pub fn skip_scanlines(&mut self, count: usize) -> Result<usize>
Skip scanlines without copying data.