Struct jpegxl_rs::JxlEncoder[][src]

pub struct JxlEncoder {
    pub pixel_format: JxlPixelFormat,
    pub parallel_runner: Option<Box<dyn JxlParallelRunner>>,
    // some fields omitted
}

JPEG XL Encoder

Fields

pixel_format: JxlPixelFormat

Pixel format

parallel_runner: Option<Box<dyn JxlParallelRunner>>

Parallel Runner

Implementations

impl JxlEncoder[src]

pub fn set_lossless(&mut self, lossless: bool)[src]

Set lossless mode. Default is lossy.

pub fn set_speed(&mut self, speed: EncoderSpeed)[src]

Set speed. Default: [EncodeSpeed::Squirrel] (7).

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

Set quality for lossy compression: target max butteraugli distance, lower = higher quality. Range: 0 .. 15.
0.0 = mathematically lossless (however, use set_lossless to use true lossless).
1.0 = visually lossless.
Recommended range: 0.5 .. 3.0.
Default value: 1.0.
If set_lossless is used, this value is unused and implied to be 0.

pub fn encode_jpeg(
    &mut self,
    data: &[u8],
    x_size: u32,
    y_size: u32
) -> Result<Vec<u8>, EncodeError>
[src]

Encode a JPEG XL image from existing raw JPEG data. Only support pixel type u8

Errors

Return EncodeError if internal encoder fails to encode

pub fn encode<T: PixelType, U: PixelType>(
    &mut self,
    data: &[T],
    x_size: u32,
    y_size: u32
) -> Result<Vec<U>, EncodeError>
[src]

Encode a JPEG XL image from pixels

Errors

Return EncodeError if internal encoder fails to encode

Trait Implementations

impl Drop for JxlEncoder[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.