pub struct JxlDecoderInner { /* private fields */ }Expand description
Low-level, less-type-safe API.
Implementations§
Source§impl JxlDecoderInner
impl JxlDecoderInner
Sourcepub fn process(
&mut self,
input: &mut dyn JxlBitstreamInput,
buffers: Option<&mut [JxlOutputBuffer<'_>]>,
) -> Result<ProcessingResult<(), ()>>
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.
Sourcepub fn flush_pixels(
&mut self,
buffers: &mut [JxlOutputBuffer<'_>],
) -> Result<()>
pub fn flush_pixels( &mut self, buffers: &mut [JxlOutputBuffer<'_>], ) -> Result<()>
Draws all the pixels we have data for.
Source§impl JxlDecoderInner
impl JxlDecoderInner
Sourcepub fn new(options: JxlDecoderOptions) -> Self
pub fn new(options: JxlDecoderOptions) -> Self
Creates a new decoder with the given options and, optionally, CMS.
Sourcepub fn basic_info(&self) -> Option<&JxlBasicInfo>
pub fn basic_info(&self) -> Option<&JxlBasicInfo>
Obtains the image’s basic information, if available.
Sourcepub fn embedded_color_profile(&self) -> Option<&JxlColorProfile>
pub fn embedded_color_profile(&self) -> Option<&JxlColorProfile>
Retrieves the file’s color profile, if available.
Sourcepub fn output_color_profile(&self) -> Option<&JxlColorProfile>
pub fn output_color_profile(&self) -> Option<&JxlColorProfile>
Retrieves the current output color profile, if available.
Sourcepub fn set_output_color_profile(
&mut self,
profile: JxlColorProfile,
) -> Result<()>
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.
pub fn current_pixel_format(&self) -> Option<&JxlPixelFormat>
pub fn set_pixel_format(&mut self, pixel_format: JxlPixelFormat)
pub fn frame_header(&self) -> Option<JxlFrameHeader>
Sourcepub fn num_completed_passes(&self) -> Option<usize>
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.
Sourcepub fn reset(&mut self)
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.
Sourcepub fn rewind(&mut self) -> bool
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.
pub fn has_more_frames(&self) -> bool
Sourcepub fn frame_index(&self) -> Option<&FrameIndexBox>
pub fn frame_index(&self) -> Option<&FrameIndexBox>
Returns the parsed frame index box, if the file contained one.
Sourcepub fn gain_map(&self) -> Option<&GainMapBundle>
pub fn gain_map(&self) -> Option<&GainMapBundle>
Returns a reference to the parsed gain map bundle, if the file contained one.
Sourcepub fn take_gain_map(&mut self) -> Option<GainMapBundle>
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.
Sourcepub fn exif(&self) -> Option<&[u8]>
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.