Skip to main content

Unpacked

Struct Unpacked 

Source
pub struct Unpacked<'a> { /* private fields */ }
Expand description

The unpack stage: Packed samples widened to a byte per component, one row at a time into a buffer it owns and reuses.

The row this yields is exactly the row the eager pass wrote into its full-size buffer — same table, same rounding, same treatment of a short or absent row — so putting the stage in front of crate::image::Converted changes when the arithmetic runs and not what it produces.

Implementations§

Source§

impl<'a> Unpacked<'a>

Source

pub fn new(packed: &'a Packed) -> Self

Start walking packed from its first row.

Source

pub fn next_row(&mut self) -> Option<&[u8]>

The next row widened to a byte per component, or None past the bottom.

A row the stream never reached yields zeroes, not the byte /Decode maps a zero sample to: PDFium returns a zeroed output buffer for an absent row without ever running the decode, so the pixels are literal black – the distinction the scanline reader’s Availability carries.

Source

pub fn collect_all(self) -> Box<[u8]>

The whole image unpacked, for the callers that genuinely want it.

The one place the full-size buffer this stage exists to avoid is built: crate::image::Samples::to_pixels, reached by the CLI’s image export, the facade’s edit path and the stencil check.

Trait Implementations§

Source§

impl<'a> Debug for Unpacked<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Unpacked<'a>

§

impl<'a> RefUnwindSafe for Unpacked<'a>

§

impl<'a> Send for Unpacked<'a>

§

impl<'a> Sync for Unpacked<'a>

§

impl<'a> Unpin for Unpacked<'a>

§

impl<'a> UnsafeUnpin for Unpacked<'a>

§

impl<'a> UnwindSafe for Unpacked<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.