Skip to main content

JxlDecoderInner

Struct JxlDecoderInner 

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

Low-level, less-type-safe API.

Implementations§

Source§

impl JxlDecoderInner

Source

pub fn process( &mut self, input: &mut dyn JxlBitstreamInput, buffers: Option<&mut [JxlOutputBuffer<'_>]>, ) -> Result<ProcessingResult<(), ()>>

Process more of the input file. This function will return when reaching the next decoding stage (i.e. finished decoding file/frame header, or finished decoding a frame). If called when decoding a frame with None for buffers, the frame will still be read, but pixel data will not be produced.

Source

pub fn flush_pixels( &mut self, buffers: &mut [JxlOutputBuffer<'_>], ) -> Result<()>

Draws all the pixels we have data for.

Source§

impl JxlDecoderInner

Source

pub fn new(options: JxlDecoderOptions) -> Self

Creates a new decoder with the given options and, optionally, CMS.

Source

pub fn basic_info(&self) -> Option<&JxlBasicInfo>

Obtains the image’s basic information, if available.

Source

pub fn embedded_color_profile(&self) -> Option<&JxlColorProfile>

Retrieves the file’s color profile, if available.

Source

pub fn output_color_profile(&self) -> Option<&JxlColorProfile>

Retrieves the current output color profile, if available.

Source

pub fn set_output_color_profile( &mut self, profile: JxlColorProfile, ) -> Result<()>

Specifies the preferred color profile to be used for outputting data. Same semantics as JxlDecoderSetOutputColorProfile.

Source

pub fn current_pixel_format(&self) -> Option<&JxlPixelFormat>

Source

pub fn set_pixel_format(&mut self, pixel_format: JxlPixelFormat)

Source

pub fn frame_header(&self) -> Option<JxlFrameHeader>

Source

pub fn num_completed_passes(&self) -> Option<usize>

Number of passes we have full data for. Returns the minimum number of passes completed across all groups.

Source

pub fn reset(&mut self)

Fully resets the decoder to its initial state.

This clears all state including pixel_format. For animation loop playback, consider using rewind instead which preserves pixel_format.

After calling this, the caller should provide input from the beginning of the file.

Source

pub fn rewind(&mut self) -> bool

Rewinds for animation loop replay, keeping pixel_format setting.

This resets the decoder but preserves the pixel_format configuration, so the caller doesn’t need to re-set it after rewinding.

After calling this, the caller should provide input from the beginning of the file. Headers will be re-parsed, then frames can be decoded again.

Returns true if pixel_format was preserved, false if none was set.

Source

pub fn has_more_frames(&self) -> bool

Source

pub fn frame_index(&self) -> Option<&FrameIndexBox>

Returns the parsed frame index box, if the file contained one.

Source

pub fn gain_map(&self) -> Option<&GainMapBundle>

Returns a reference to the parsed gain map bundle, if the file contained one.

Source

pub fn take_gain_map(&mut self) -> Option<GainMapBundle>

Takes the parsed gain map bundle, if the file contained one. After calling this, gain_map() will return None.

Source

pub fn exif(&self) -> Option<&[u8]>

Returns the raw EXIF data from the Exif container box, if present.

The 4-byte TIFF header offset prefix has been stripped; this returns the raw EXIF/TIFF bytes starting with the byte-order marker (II or MM). Returns None for bare codestreams or files without an Exif box.

Source

pub fn take_exif(&mut self) -> Option<Vec<u8>>

Takes the EXIF data, leaving None in its place.

Source

pub fn xmp(&self) -> Option<&[u8]>

Returns the raw XMP data from the xml container box, if present.

Returns None for bare codestreams or files without an xml box.

Source

pub fn take_xmp(&mut self) -> Option<Vec<u8>>

Takes the XMP data, leaving None in its place.

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