Skip to main content

JxlEncoder

Struct JxlEncoder 

Source
pub struct JxlEncoder { /* private fields */ }
Expand description

Encodes a JPEG XL codestream.

Implementations§

Source§

impl JxlEncoder

Source

pub const fn new() -> JxlEncoder

A lossy encoder at distance 1, visually lossless.

Source

pub const fn lossless() -> JxlEncoder

A lossless encoder.

Source

pub const fn with_distance(distance: f32) -> JxlEncoder

A lossy encoder at distance: 1 is visually lossless, 0.5 finer, up to 25 for the coarsest.

Source

pub fn from_options(options: &EncodeOptions) -> JxlEncoder

An encoder configured from generic encode options: lossless if lossless, otherwise lossy at the distance libjxl’s cjxl gives quality (90 is distance 1).

Trait Implementations§

Source§

impl Debug for JxlEncoder

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for JxlEncoder

Source§

fn default() -> JxlEncoder

Returns the “default value” for a type. Read more
Source§

impl Encoder for JxlEncoder

Source§

fn set_exif(&mut self, exif: Option<&[u8]>) -> Result<(), PixelsError>

Written in an Exif box, which puts the file in the container.

Source§

fn set_xmp(&mut self, xmp: Option<&[u8]>) -> Result<(), PixelsError>

Written in an xml box, which puts the file in the container.

Source§

fn write_header( &mut self, desc: &ImageDescriptor, _sink: &mut dyn Sink, ) -> Result<(), PixelsError>

Begin an image, writing any container header. Read more
Source§

fn write_row( &mut self, row: &[u8], _sink: &mut dyn Sink, ) -> Result<(), PixelsError>

Write the next row, top to bottom. Read more
Source§

fn finish(&mut self, sink: &mut dyn Sink) -> Result<(), PixelsError>

Finish the image, writing any trailer and flushing the sink. Read more
Source§

fn set_icc_profile(&mut self, profile: Option<&[u8]>) -> Result<(), PixelsError>

Embed profile as the image’s ICC colour profile, or write none. Read more
Source§

fn set_density(&mut self, density: Option<Density>) -> Result<(), PixelsError>

Record density as the image’s resolution, or write the format’s default. Read more

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 = !

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.