[−][src]Struct lzw::DecoderEarlyChange
Decoder for a LZW compressed stream using an “early change” algorithm (used in TIFF files).
The maximum supported code size is 16 bits. The decoder assumes two special code word to be present in the stream:
CLEAR_CODE == 1 << min_code_size
END_CODE == CLEAR_CODE + 1
Furthermore the decoder expects the stream to start with a CLEAR_CODE
. This
corresponds to the implementation needed for en- and decoding GIF and TIFF files.
Methods
impl<R> DecoderEarlyChange<R> where
R: BitReader,
[src]
R: BitReader,
pub fn new(reader: R, min_code_size: u8) -> DecoderEarlyChange<R>
[src]
Creates a new LZW decoder.
pub fn decode_bytes(&mut self, bytes: &[u8]) -> Result<(usize, &[u8])>
[src]
Tries to obtain and decode a code word from bytes
.
Returns the number of bytes that have been consumed from bytes
. An empty
slice does not indicate EOF
.
Trait Implementations
impl<R: Debug + BitReader> Debug for DecoderEarlyChange<R>
[src]
Auto Trait Implementations
impl<R> Send for DecoderEarlyChange<R> where
R: Send,
R: Send,
impl<R> Unpin for DecoderEarlyChange<R> where
R: Unpin,
R: Unpin,
impl<R> Sync for DecoderEarlyChange<R> where
R: Sync,
R: Sync,
impl<R> UnwindSafe for DecoderEarlyChange<R> where
R: UnwindSafe,
R: UnwindSafe,
impl<R> RefUnwindSafe for DecoderEarlyChange<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,