Struct mozjpeg::decompress::Decompress[][src]

pub struct Decompress<'src> { /* fields omitted */ }

Get pixels out of a JPEG file

High-level wrapper for jpeg_decompress_struct

let d = Decompress::new_path("image.jpg")?;

Implementations

impl<'src> Decompress<'src>[src]

pub fn with_err(err: ErrorMgr) -> DecompressConfig<'static>[src]

pub fn with_markers(save_markers: &[Marker]) -> DecompressConfig<'_>[src]

pub fn new_path<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Decode file at path

pub fn new_file(file: File) -> Result<Self>[src]

Decode an already-opened file

pub fn new_mem(mem: &'src [u8]) -> Result<Self>[src]

pub fn components(&self) -> &[CompInfo][src]

pub fn components_mut(&mut self) -> &mut [CompInfo][src]

pub fn color_space(&self) -> COLOR_SPACE[src]

pub fn gamma(&self) -> f64[src]

pub fn markers(&self) -> MarkerIter<'_>

Notable traits for MarkerIter<'a>

impl<'a> Iterator for MarkerIter<'a> type Item = MarkerData<'a>;
[src]

Markers are available only if you enable them via with_markers()

pub fn size(&self) -> (usize, usize)[src]

width,height

pub fn width(&self) -> usize[src]

pub fn height(&self) -> usize[src]

pub fn rgb(self) -> Result<DecompressStarted<'src>>[src]

Start decompression with conversion to RGB

pub fn to_colorspace(
    self,
    colorspace: ColorSpace
) -> Result<DecompressStarted<'src>>
[src]

Start decompression with conversion to colorspace

pub fn rgba(self) -> Result<DecompressStarted<'src>>[src]

Start decompression with conversion to RGBA

pub fn grayscale(self) -> Result<DecompressStarted<'src>>[src]

Start decompression with conversion to grayscale.

pub fn dct_method(&mut self, method: DctMethod)[src]

Selects the algorithm used for the DCT step.

pub fn do_fancy_upsampling(&mut self, value: bool)[src]

pub fn do_block_smoothing(&mut self, value: bool)[src]

If true, interblock smoothing is applied in early stages of decoding progressive JPEG files; if false, not. Default is true. Early progression stages look “fuzzy” with smoothing, “blocky” without. In any case, block smoothing ceases to be applied after the first few AC coefficients are known to full accuracy, so it is relevant only when using buffered-image mode for progressive images.

pub fn raw(self) -> Result<DecompressStarted<'src>>[src]

pub fn image(self) -> Result<Format<'src>>[src]

Start decompression without colorspace conversion

pub fn scale(&mut self, numerator: u8)[src]

Rescales the output image by numerator / 8 during decompression. numerator must be between 1 and 16. Thus setting a value of 8 will result in an unscaled image.

Trait Implementations

impl<'src> Drop for Decompress<'src>[src]

Auto Trait Implementations

impl<'src> RefUnwindSafe for Decompress<'src>

impl<'src> !Send for Decompress<'src>

impl<'src> !Sync for Decompress<'src>

impl<'src> Unpin for Decompress<'src>

impl<'src> UnwindSafe for Decompress<'src>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.