pub struct RandomAccessDecoder<D: ScanlineDecoder> { /* private fields */ }Expand description
Random-access scanline decoder wrapper.
Wraps any ScanlineDecoder and adds get_scanline(line) support with
caching and rewind logic. Ported from upstream PDFium’s
ScanlineDecoder::GetScanline(int line).
Implementations§
Source§impl<D: ScanlineDecoder> RandomAccessDecoder<D>
impl<D: ScanlineDecoder> RandomAccessDecoder<D>
Sourcepub fn get_scanline(
&mut self,
line: usize,
) -> Result<Option<&[u8]>, DecodeError>
pub fn get_scanline( &mut self, line: usize, ) -> Result<Option<&[u8]>, DecodeError>
Get a specific scanline by line index (0-based).
If the requested line is the one just decoded, returns a cached copy. If the requested line is before the current position, rewinds and re-reads sequentially. Matches upstream PDFium’s caching pattern.
Sourcepub fn count_comps(&self) -> u8
pub fn count_comps(&self) -> u8
Number of color components per pixel.
Sourcepub fn row_stride(&self) -> usize
pub fn row_stride(&self) -> usize
Number of bytes per row.
Auto Trait Implementations§
impl<D> Freeze for RandomAccessDecoder<D>where
D: Freeze,
impl<D> RefUnwindSafe for RandomAccessDecoder<D>where
D: RefUnwindSafe,
impl<D> Send for RandomAccessDecoder<D>where
D: Send,
impl<D> Sync for RandomAccessDecoder<D>where
D: Sync,
impl<D> Unpin for RandomAccessDecoder<D>where
D: Unpin,
impl<D> UnsafeUnpin for RandomAccessDecoder<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for RandomAccessDecoder<D>where
D: UnwindSafe,
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