Skip to main content

CompressStarted

Struct CompressStarted 

Source
pub struct CompressStarted<W> { /* private fields */ }

Implementations§

Source§

impl<W> CompressStarted<W>

Source

pub fn write_marker(&mut self, marker: Marker, data: &[u8])

Add a marker to compressed file

Data is max 64KB

§Panics

It may panic, like all functions of this library.

Source

pub fn write_icc_profile(&mut self, data: &[u8])

Add ICC profile to compressed file

§Panics

It may panic, like all functions of this library.

Source

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

Read-only view of component information

Source§

impl<W> CompressStarted<W>

Source

pub fn write_scanlines(&mut self, image_src: &[u8]) -> Result<()>

Returns Ok(()) if all lines in image_src (not necessarily all lines of the image) were written

§Panics

It may panic, like all functions of this library.

Source

pub fn write_raw_data(&mut self, image_src: &[&[u8]]) -> bool

Advanced. Only possible after set_raw_data_in(). Write YCbCr blocks pixels instead of usual color space

See raw_data_in in libjpeg docs

§Panic

Panics if raw write wasn’t enabled

Source§

impl<W: Write> CompressStarted<W>

Source

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

Finalize compression. In case of progressive files, this may actually start processing.

§Panics

It may panic, like all functions of this library.

Source

pub fn abort(self) -> W

Give up writing, return incomplete result

Auto Trait Implementations§

§

impl<W> Freeze for CompressStarted<W>

§

impl<W> RefUnwindSafe for CompressStarted<W>
where W: RefUnwindSafe,

§

impl<W> !Send for CompressStarted<W>

§

impl<W> !Sync for CompressStarted<W>

§

impl<W> !Unpin for CompressStarted<W>

§

impl<W> !UnsafeUnpin for CompressStarted<W>

§

impl<W> UnwindSafe for CompressStarted<W>
where W: UnwindSafe,

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.