Skip to main content

JxlBasicInfo

Struct JxlBasicInfo 

Source
#[non_exhaustive]
pub struct JxlBasicInfo { pub size: (usize, usize), pub coded_size: (usize, usize), pub bit_depth: JxlBitDepth, pub orientation: Orientation, pub intrinsic_orientation: Orientation, pub extra_channels: Vec<JxlExtraChannel>, pub animation: Option<JxlAnimation>, pub uses_original_profile: bool, pub tone_mapping: ToneMapping, pub preview_size: Option<(usize, usize)>, pub intrinsic_size: Option<(usize, usize)>, }

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§size: (usize, usize)

Dimensions of the pixel data the decoder will emit, in the order the output buffer must be laid out ((width, height)).

This depends on JxlDecoderOptions::adjust_orientation:

  • When orientation is adjusted (the default, “Correct”), the stored orientation is baked into the output, so this is the display size (width/height are swapped relative to Self::coded_size for transposing orientations).
  • When orientation adjustment is disabled (“Preserve”), pixels are emitted in their stored orientation, so this equals Self::coded_size.

Allocate output buffers against this size.

§coded_size: (usize, usize)

The stored (coded) dimensions of the image as written in the codestream, (width, height), before any orientation is applied. Unaffected by JxlDecoderOptions::adjust_orientation. For transposing orientations this differs from the display size; see Self::size.

§bit_depth: JxlBitDepth§orientation: Orientation

Orientation of the pixels the decoder emits, i.e. the residual transform a caller must still apply to obtain an upright image.

This depends on JxlDecoderOptions::adjust_orientation:

  • When orientation is adjusted (the default, “Correct”), the stored orientation has already been baked into the output pixels, so this is Orientation::Identity.
  • When orientation adjustment is disabled (“Preserve”), this is the image’s stored orientation (equal to Self::intrinsic_orientation), which the caller should bake into the Self::coded_size pixels to display them upright.
§intrinsic_orientation: Orientation

The image’s intrinsic (stored) EXIF/container orientation as written in the codestream, regardless of JxlDecoderOptions::adjust_orientation.

Use this to re-tag re-encoded output or to decide how to bake the stored orientation. In “Correct” mode the emitted pixels are already upright even though this reports a non-Identity value; in “Preserve” mode this equals Self::orientation.

§extra_channels: Vec<JxlExtraChannel>§animation: Option<JxlAnimation>§uses_original_profile: bool§tone_mapping: ToneMapping§preview_size: Option<(usize, usize)>§intrinsic_size: Option<(usize, usize)>

Intrinsic display size, if different from coded size.

When present, the image should be rendered at this (width, height) rather than the coded size. Used for resolution-independence (e.g. a 4000×3000 image meant to display at 2000×1500).

Trait Implementations§

Source§

impl Clone for JxlBasicInfo

Source§

fn clone(&self) -> JxlBasicInfo

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

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> 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, 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> 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.