Skip to main content

LibjxlEncodeConfig

Struct LibjxlEncodeConfig 

Source
pub struct LibjxlEncodeConfig {
Show 21 fields pub common: CommonEncodeOptions, pub distance: f32, pub quality: Option<f32>, pub lossless: bool, pub effort: u8, pub brotli_effort: i8, pub decoding_speed: u8, pub progressive: bool, pub modular: LibjxlModular, pub color_transform: LibjxlColorTransform, pub epf: i8, pub gaborish: Option<bool>, pub noise: Option<bool>, pub dots: Option<bool>, pub patches: Option<bool>, pub photon_noise_iso: f32, pub resampling: i8, pub use_container: bool, pub codestream_level: i8, pub extra_int_options: Vec<(i32, i64)>, pub extra_float_options: Vec<(i32, f32)>,
}
Expand description

Configuration for the libjxl JPEG XL encoder (the reference encoder).

Unlike the zune-jpegxl default (ZuneJxlEncodeConfig), libjxl honours 8- and 16-bit output, mathematically lossless encoding, and the full set of JxlEncoderFrameSettingId toggles. Requires the jxl-encode-libjxl feature.

Integer fields default to a -1 sentinel and Option fields to None, meaning “leave at libjxl’s own default”. This is a plain struct (not #[non_exhaustive]): construct it with a struct literal plus ..Default::default(). The two extra_*_options vectors are escape hatches that pass raw frame-setting ids through verbatim, so every libjxl toggle is reachable even if it has no dedicated field.

Fields§

§common: CommonEncodeOptions

Encoder-agnostic options. libjxl honours BitDepth::Eight and BitDepth::Sixteen.

§distance: f32

Butteraugli distance: 0.0 is mathematically lossless, 1.0 visually lossless, up to 25.0 (smaller files, monotonic). Ignored when quality is Some or lossless is true.

§quality: Option<f32>

Optional JPEG-style quality, 0.0..=100.0. When Some, libjxl converts it to a distance and it overrides distance.

§lossless: bool

Force bit-exact lossless encoding (overrides distance/quality).

§effort: u8

Effort / speed-quality trade-off, 1 (fastest) ..= 10 (slowest, best).

§brotli_effort: i8

Brotli effort for the metadata/modular streams, -1 (default) or 0..=11.

§decoding_speed: u8

Decoder-speed tier the stream is optimised for, 0 (default, best) ..= 4.

§progressive: bool

Emit a responsive / progressive stream (sets RESPONSIVE + PROGRESSIVE_DC).

§modular: LibjxlModular

Modular vs VarDCT mode.

§color_transform: LibjxlColorTransform

Internal color transform.

§epf: i8

Edge-preserving filter strength, -1 (default) ..= 3.

§gaborish: Option<bool>

Gaborish deblocking filter: None = default, Some(false)/Some(true) = off/on.

§noise: Option<bool>

Adaptive noise synthesis: None = default, Some(false)/Some(true) = off/on.

§dots: Option<bool>

Dots synthesis: None = default, Some(false)/Some(true) = off/on.

§patches: Option<bool>

Patches synthesis: None = default, Some(false)/Some(true) = off/on.

§photon_noise_iso: f32

Photon-noise simulation strength in ISO units (0.0 = off).

§resampling: i8

Downsampling factor, -1 (default), 1, 2, 4, or 8.

§use_container: bool

Force the BMFF container even when a bare codestream would do.

§codestream_level: i8

JPEG XL codestream feature level: -1 (auto), 5, or 10.

§extra_int_options: Vec<(i32, i64)>

Escape hatch: raw (JxlEncoderFrameSettingId, value) integer settings applied verbatim, for any toggle without a dedicated field above.

§extra_float_options: Vec<(i32, f32)>

Escape hatch: raw (JxlEncoderFrameSettingId, value) float settings.

Trait Implementations§

Source§

impl Clone for LibjxlEncodeConfig

Source§

fn clone(&self) -> LibjxlEncodeConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LibjxlEncodeConfig

Source§

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

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

impl Default for LibjxlEncodeConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for LibjxlEncodeConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for LibjxlEncodeConfig

Source§

fn eq(&self, other: &LibjxlEncodeConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for LibjxlEncodeConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for LibjxlEncodeConfig

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, Ctx> BundleDefault<Ctx> for T
where T: Default,

Source§

fn default_with_context(_: Ctx) -> T

Creates a default value with the given context.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,