pub struct Decoder<R> { /* private fields */ }
Expand description

JPEG decoder

Implementations

Creates a new Decoder using the reader reader.

Returns metadata about the image.

The returned value will be None until a call to either read_info or decode has returned Ok.

Returns the embeded icc profile if the image contains one.

Tries to read metadata from the image without decoding it.

If successful, the metadata can be obtained using the info method.

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.

Decodes the image and returns the decoded pixels if successful.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.