pub struct BitReader<'a> { /* private fields */ }Expand description
Reads bits from a byte slice, handling JPEG-LS FF-bitstuffing.
Implementations§
Source§impl<'a> BitReader<'a>
impl<'a> BitReader<'a>
pub fn new(data: &'a [u8]) -> Self
Sourcepub fn byte_position(&self) -> usize
pub fn byte_position(&self) -> usize
Current byte position in the source data.
Sourcepub fn read_value(&mut self, length: i32) -> DcmResult<i32>
pub fn read_value(&mut self, length: i32) -> DcmResult<i32>
Read length bits (up to 25) and return them right-aligned.
Sourcepub fn peek_byte(&mut self) -> i32
pub fn peek_byte(&mut self) -> i32
Peek at the top 8 bits of the cache (for lookup-table decoding).
Sourcepub fn read_highbits(&mut self) -> DcmResult<i32>
pub fn read_highbits(&mut self) -> DcmResult<i32>
Count leading zero bits (up to 16).
Auto Trait Implementations§
impl<'a> Freeze for BitReader<'a>
impl<'a> RefUnwindSafe for BitReader<'a>
impl<'a> Send for BitReader<'a>
impl<'a> Sync for BitReader<'a>
impl<'a> Unpin for BitReader<'a>
impl<'a> UnsafeUnpin for BitReader<'a>
impl<'a> UnwindSafe for BitReader<'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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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