pub struct GifDecoder<R>where
R: Read,{ /* private fields */ }Expand description
GIF decoder
Implementations§
Source§impl<R> GifDecoder<R>where
R: Read,
impl<R> GifDecoder<R>where
R: Read,
Sourcepub fn new(r: R) -> Result<GifDecoder<R>, ImageError>
pub fn new(r: R) -> Result<GifDecoder<R>, ImageError>
Creates a new decoder that decodes the input steam r
Sourcepub fn with_limits(r: R, limits: Limits) -> Result<GifDecoder<R>, ImageError>
👎Deprecated since 0.24.8: Use new followed by set_limits instead
pub fn with_limits(r: R, limits: Limits) -> Result<GifDecoder<R>, ImageError>
new followed by set_limits insteadCreates a new decoder that decodes the input steam r, using limits limits
Trait Implementations§
Source§impl<'a, R> AnimationDecoder<'a> for GifDecoder<R>where
R: Read + 'a,
impl<'a, R> AnimationDecoder<'a> for GifDecoder<R>where
R: Read + 'a,
Source§fn into_frames(self) -> Frames<'a> ⓘ
fn into_frames(self) -> Frames<'a> ⓘ
Consume the decoder producing a series of frames.
Source§impl<'a, R> ImageDecoder<'a> for GifDecoder<R>where
R: 'a + Read,
impl<'a, R> ImageDecoder<'a> for GifDecoder<R>where
R: 'a + Read,
Source§fn dimensions(&self) -> (u32, u32)
fn dimensions(&self) -> (u32, u32)
Returns a tuple containing the width and height of the image
Source§fn color_type(&self) -> ColorType
fn color_type(&self) -> ColorType
Returns the color type of the image data produced by this decoder
Source§fn into_reader(
self,
) -> Result<<GifDecoder<R> as ImageDecoder<'a>>::Reader, ImageError>
fn into_reader( self, ) -> Result<<GifDecoder<R> as ImageDecoder<'a>>::Reader, ImageError>
👎Deprecated: Planned for removal. See https://github.com/image-rs/image/issues/1989
Returns a reader that can be used to obtain the bytes of the image. For the best
performance, always try to read at least
scanline_bytes from the reader at a time. Reading
fewer bytes will cause the reader to perform internal buffering.Source§fn set_limits(&mut self, limits: Limits) -> Result<(), ImageError>
fn set_limits(&mut self, limits: Limits) -> Result<(), ImageError>
Source§fn read_image(self, buf: &mut [u8]) -> Result<(), ImageError>
fn read_image(self, buf: &mut [u8]) -> Result<(), ImageError>
Returns all the bytes in the image. Read more
Source§fn original_color_type(&self) -> ExtendedColorType
fn original_color_type(&self) -> ExtendedColorType
Returns the color type of the image file before decoding
Source§fn icc_profile(&mut self) -> Option<Vec<u8>>
fn icc_profile(&mut self) -> Option<Vec<u8>>
Returns the ICC color profile embedded in the image Read more
Source§fn total_bytes(&self) -> u64
fn total_bytes(&self) -> u64
Returns the total number of bytes in the decoded image. Read more
Source§fn scanline_bytes(&self) -> u64
fn scanline_bytes(&self) -> u64
👎Deprecated: Planned for removal. See https://github.com/image-rs/image/issues/1989
Returns the minimum number of bytes that can be efficiently read from this decoder. This may
be as few as 1 or as many as
total_bytes().Source§fn read_image_with_progress<F>(
self,
buf: &mut [u8],
progress_callback: F,
) -> Result<(), ImageError>
fn read_image_with_progress<F>( self, buf: &mut [u8], progress_callback: F, ) -> Result<(), ImageError>
👎Deprecated: Use read_image instead. See https://github.com/image-rs/image/issues/1989
Same as
read_image but periodically calls the provided callback to give updates on loading
progress.Auto Trait Implementations§
impl<R> Freeze for GifDecoder<R>where
R: Freeze,
impl<R> !RefUnwindSafe for GifDecoder<R>
impl<R> Send for GifDecoder<R>where
R: Send,
impl<R> !Sync for GifDecoder<R>
impl<R> Unpin for GifDecoder<R>where
R: Unpin,
impl<R> !UnwindSafe for GifDecoder<R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<Target, Original> VectorizedInto<Target> for Originalwhere
Target: VectorizedFrom<Original>,
impl<Target, Original> VectorizedInto<Target> for Originalwhere
Target: VectorizedFrom<Original>,
Source§fn vectorized_into(self) -> Target
fn vectorized_into(self) -> Target
Performs the conversion.