Struct image::jpeg::JpegDecoder[][src]

pub struct JpegDecoder<R> { /* fields omitted */ }

JPEG decoder

Implementations

impl<R: Read> JpegDecoder<R>[src]

pub fn new(r: R) -> ImageResult<JpegDecoder<R>>[src]

Create a new decoder that decodes from the stream r

pub fn scale(
    &mut self,
    requested_width: u16,
    requested_height: u16
) -> ImageResult<(u16, u16)>
[src]

Configure the decoder to scale the image during decoding.

This efficiently scales the image by the smallest supported scale factor that produces an image larger than or equal to the requested size in at least one axis. The currently implemented scale factors are 1/8, 1/4, 1/2 and 1.

To generate a thumbnail of an exact size, pass the desired size and then scale to the final size using a traditional resampling algorithm.

The size of the image to be loaded, with the scale factor applied, is returned.

Trait Implementations

impl<'a, R: 'a + Read> ImageDecoder<'a> for JpegDecoder<R>[src]

type Reader = JpegReader<R>

The type of reader produced by into_reader.

Auto Trait Implementations

impl<R> RefUnwindSafe for JpegDecoder<R> where
    R: RefUnwindSafe

impl<R> Send for JpegDecoder<R> where
    R: Send

impl<R> Sync for JpegDecoder<R> where
    R: Sync

impl<R> Unpin for JpegDecoder<R> where
    R: Unpin

impl<R> UnwindSafe for JpegDecoder<R> where
    R: UnwindSafe

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.