Skip to main content

DecompressStarted

Struct DecompressStarted 

Source
pub struct DecompressStarted<R> { /* private fields */ }
Expand description

See methods on Decompress

Implementations§

Source§

impl<R> DecompressStarted<R>

Source

pub fn color_space(&self) -> ColorSpace

Source

pub fn min_flat_buffer_size(&self) -> usize

Gets the minimal buffer size for using DecompressStarted::read_scanlines_flat_into

Source

pub fn read_raw_data(&mut self, image_dest: &mut [&mut Vec<JSAMPLE>])

Append data

Source

pub fn width(&self) -> usize

Source

pub fn height(&self) -> usize

Source

pub fn read_scanlines<T: Pod>(&mut self) -> Result<Vec<T>>

Supports any pixel type that is marked as “plain old data”, see bytemuck crate.

Pixels can either have number of bytes matching number of channels, e.g. RGB as [u8; 3] or rgb::RGB8, or be an amorphous blob of u8s.

Source

pub fn read_scanlines_into<'dest, T: Pod>( &mut self, dest: &'dest mut [T], ) -> Result<&'dest mut [T]>

Supports any pixel type that is marked as “plain old data”, see bytemuck crate. [u8; 3] and rgb::RGB8 are fine, for example. [u8] is allowed for any pixel type.

Allocation-less version of read_scanlines

Source

pub fn read_scanlines_into_uninit<'dest, T: Pod>( &mut self, dest: &'dest mut [MaybeUninit<T>], ) -> Result<&'dest mut [T]>

Returns written-to slice

Source

pub fn components(&self) -> &[CompInfo]

Source

pub fn finish_into_inner(self) -> Result<R>
where R: BufRead,

Finish decompress and return the reader

Source

pub fn finish(self) -> Result<()>

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.