[][src]Struct mozjpeg::Compress

pub struct Compress { /* fields omitted */ }

Create a new JPEG file from pixels

Wrapper for jpeg_compress_struct

Methods

impl Compress
[src]

pub fn new(color_space: ColorSpace) -> Compress
[src]

Compress image using input in this colorspace

By default errors cause panic and unwind through the C code, which strictly speaking is not guaranteed to work in Rust (but seems to work fine, at least in x86/64).

pub fn new_err(err: ErrorMgr, color_space: ColorSpace) -> Compress
[src]

pub fn start_compress(&mut self)
[src]

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

pub fn components_mut(&mut self) -> &mut [CompInfo]
[src]

Expose components for modification

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

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

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

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

pub fn set_color_space(&mut self, color_space: ColorSpace)
[src]

pub fn set_size(&mut self, width: usize, height: usize)
[src]

pub fn set_gamma(&mut self, gamma: f64)
[src]

pub fn set_optimize_scans(&mut self, opt: bool)
[src]

pub fn set_optimize_coding(&mut self, opt: bool)
[src]

Set to false to make files larger for no reason

pub fn set_use_scans_in_trellis(&mut self, opt: bool)
[src]

pub fn set_progressive_mode(&mut self)
[src]

You can only turn it on

pub fn set_scan_optimization_mode(&mut self, mode: ScanMode)
[src]

pub fn set_fastest_defaults(&mut self)
[src]

Reset to libjpeg v6 settings

pub fn set_raw_data_in(&mut self, opt: bool)
[src]

pub fn set_quality(&mut self, quality: f32)
[src]

pub fn set_luma_qtable(&mut self, qtable: &QTable)
[src]

pub fn set_chroma_qtable(&mut self, qtable: &QTable)
[src]

pub fn set_mem_dest(&mut self)
[src]

pub fn finish_compress(&mut self)
[src]

pub fn data_as_mut_slice(&mut self) -> Result<&[u8], ()>
[src]

pub fn data_to_vec(&mut self) -> Result<Vec<u8>, ()>
[src]

Trait Implementations

impl Drop for Compress
[src]

Auto Trait Implementations

impl !Send for Compress

impl !Sync for Compress

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]