Struct gif::reader::decoder::FrameDecoder
source · pub struct FrameDecoder {
lzw_reader: LzwReader,
pixel_converter: PixelConverter,
}
Expand description
Decoder for Frame::make_lzw_pre_encoded
Fields§
§lzw_reader: LzwReader
§pixel_converter: PixelConverter
Implementations§
source§impl FrameDecoder
impl FrameDecoder
sourcepub fn new(options: DecodeOptions) -> Self
pub fn new(options: DecodeOptions) -> Self
See also set_global_palette
sourcepub fn set_global_palette(&mut self, palette: Vec<u8>)
pub fn set_global_palette(&mut self, palette: Vec<u8>)
Palette used for RGBA conversion
sourcepub fn decode_lzw_encoded_frame(
&mut self,
frame: &mut Frame<'_>,
) -> Result<(), DecodingError>
pub fn decode_lzw_encoded_frame( &mut self, frame: &mut Frame<'_>, ) -> Result<(), DecodingError>
Converts the frame in-place, replacing its LZW buffer with pixels.
If you get an error about invalid min code size, the buffer was probably pixels, not compressed data.
sourcepub fn decode_lzw_encoded_frame_into_buffer(
&mut self,
frame: &Frame<'_>,
buf: &mut [u8],
) -> Result<(), DecodingError>
pub fn decode_lzw_encoded_frame_into_buffer( &mut self, frame: &Frame<'_>, buf: &mut [u8], ) -> Result<(), DecodingError>
Converts into the given buffer. It must be [buffer_size()
] bytes large.
Pixels are always deinterlaced, so update frame.interlaced
afterwards if you’re putting the buffer back into the frame.
sourcepub fn buffer_size(&self, frame: &Frame<'_>) -> usize
pub fn buffer_size(&self, frame: &Frame<'_>) -> usize
Number of bytes required for decode_lzw_encoded_frame_into_buffer
Auto Trait Implementations§
impl Freeze for FrameDecoder
impl !RefUnwindSafe for FrameDecoder
impl Send for FrameDecoder
impl !Sync for FrameDecoder
impl Unpin for FrameDecoder
impl !UnwindSafe for FrameDecoder
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