pub struct BitPumpJpeg<'a> { /* private fields */ }Expand description
MSB-first pump for JPEG entropy-coded segments: removes FF 00 byte stuffing and
stops (feeding zeros) at a marker (FF xx, xx != 0).
Implementations§
Source§impl<'a> BitPumpJpeg<'a>
impl<'a> BitPumpJpeg<'a>
pub fn new(data: &'a [u8]) -> Self
Sourcepub fn marker_hit(&self) -> bool
pub fn marker_hit(&self) -> bool
Whether a marker terminated the stream.
Sourcepub fn raw_position(&self) -> usize
pub fn raw_position(&self) -> usize
Byte offset of the read cursor in the source (after unstuffing accounting).
Sourcepub fn reset_at_restart(&mut self) -> bool
pub fn reset_at_restart(&mut self) -> bool
Reset to the byte position after a restart marker (FF D0..D7), if present.
Trait Implementations§
Source§impl BitRead for BitPumpJpeg<'_>
impl BitRead for BitPumpJpeg<'_>
Source§fn refill_force(&mut self)
fn refill_force(&mut self)
Refill to the pump’s maximum fill level even if 32 or more bits are buffered.
Source§fn peek_no_fill(&self, n: u32) -> u32
fn peek_no_fill(&self, n: u32) -> u32
Peek
n <= 32 bits. Requires a prior BitRead::fill.Source§fn skip_no_fill(&mut self, n: u32)
fn skip_no_fill(&mut self, n: u32)
Discard
n <= 32 bits. Requires that n bits are buffered.Source§fn byte_position(&self) -> usize
fn byte_position(&self) -> usize
Number of bytes consumed from the input (bits not yet used are excluded).
Source§fn overrun(&self) -> usize
fn overrun(&self) -> usize
Bytes requested past the end of the input (0 for a well-formed stream). Includes
look-ahead that has not been consumed; see
BitRead::past_end.Source§fn past_end(&self) -> usize
fn past_end(&self) -> usize
Bytes consumed beyond the end of the input (padding fed but still buffered is
not counted). Decoders use this to detect truncated streams precisely.
Source§fn fill_to(&mut self, n: u32)
fn fill_to(&mut self, n: u32)
Ensure at least
n bits (n <= 56) are buffered (zero padding past the end).fn peek(&mut self, n: u32) -> u32
fn get(&mut self, n: u32) -> u32
fn skip(&mut self, n: u32)
Auto Trait Implementations§
impl<'a> Freeze for BitPumpJpeg<'a>
impl<'a> RefUnwindSafe for BitPumpJpeg<'a>
impl<'a> Send for BitPumpJpeg<'a>
impl<'a> Sync for BitPumpJpeg<'a>
impl<'a> Unpin for BitPumpJpeg<'a>
impl<'a> UnsafeUnpin for BitPumpJpeg<'a>
impl<'a> UnwindSafe for BitPumpJpeg<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more