Struct jxl_oxide::JxlImage

source ·
pub struct JxlImage { /* private fields */ }
Expand description

JPEG XL image.

Implementations§

source§

impl JxlImage

source

pub fn builder() -> JxlImageBuilder

Creates a decoder builder with default options.

source

pub fn feed_bytes(&mut self, buf: &[u8]) -> Result<()>

Feeds more data into the decoder.

source§

impl JxlImage

source

pub fn image_header(&self) -> &ImageHeader

Returns the image header.

source

pub fn width(&self) -> u32

Returns the image width with orientation applied.

source

pub fn height(&self) -> u32

Returns the image height with orientation applied.

source

pub fn set_cms( &mut self, cms: impl ColorManagementSystem + Send + Sync + 'static )

Sets color management system implementation to be used by the renderer.

source

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

Returns the original ICC profile embedded in the image.

source

pub fn rendered_icc(&self) -> Vec<u8>

Returns the ICC profile that describes rendered images.

The returned profile will change if different color encoding is specified using request_icc or request_color_encoding.

source

pub fn rendered_cicp(&self) -> Option<[u8; 4]>

Returns the CICP tag of the color encoding of rendered images, if there’s any.

source

pub fn pixel_format(&self) -> PixelFormat

Returns the pixel format of the rendered image.

source

pub fn request_icc(&mut self, icc_profile: &[u8]) -> Result<()>

Requests the decoder to render in specific color encoding, described by an ICC profile.

§Errors

This function will return an error if it cannot parse the ICC profile.

source

pub fn request_color_encoding(&mut self, color_encoding: EnumColourEncoding)

Requests the decoder to render in specific color encoding, described by EnumColourEncoding.

source

pub fn render_spot_colour(&self) -> bool

Returns whether the spot color channels will be rendered.

source

pub fn set_render_spot_colour(&mut self, render_spot_colour: bool) -> &mut Self

Sets whether the spot colour channels will be rendered.

source

pub fn set_image_region(&mut self, region: CropInfo) -> &mut Self

source§

impl JxlImage

source

pub fn num_loaded_keyframes(&self) -> usize

Returns the number of currently loaded keyframes.

source

pub fn num_loaded_frames(&self) -> usize

Returns the number of currently loaded frames, including frames that are not displayed directly.

source

pub fn is_loading_done(&self) -> bool

Returns whether the image is loaded completely, without missing animation keyframes or partially loaded frames.

source

pub fn frame_by_keyframe(&self, keyframe_index: usize) -> Option<&IndexedFrame>

Returns frame data by keyframe index.

source

pub fn frame_header(&self, keyframe_index: usize) -> Option<&FrameHeader>

Returns the frame header for the given keyframe index, or None if the keyframe does not exist.

source

pub fn frame(&self, frame_idx: usize) -> Option<&IndexedFrame>

Returns frame data by frame index, including frames that are not displayed directly.

There are some situations where a frame is not displayed directly:

  • It may be marked as reference only, and meant to be only used by other frames.
  • It may contain LF image (which is 8x downsampled version) of another VarDCT frame.
  • Zero duration frame that is not the last frame of image is blended with following frames and displayed together.
source

pub fn frame_offset(&self, frame_index: usize) -> Option<usize>

Returns the offset of frame within codestream, in bytes.

source§

impl JxlImage

source

pub fn render_frame(&self, keyframe_index: usize) -> Result<Render>

Renders the given keyframe.

source

pub fn render_frame_cropped(&self, keyframe_index: usize) -> Result<Render>

Renders the given keyframe with optional cropping region.

source

pub fn render_loading_frame(&mut self) -> Result<Render>

Renders the currently loading keyframe.

source

pub fn render_loading_frame_cropped(&mut self) -> Result<Render>

Renders the currently loading keyframe with optional cropping region.

source§

impl JxlImage

source

pub fn pool(&self) -> &JxlThreadPool

Returns the thread pool used by the renderer.

source

pub fn reader(&self) -> &ContainerDetectingReader

Returns the internal reader.

Trait Implementations§

source§

impl Debug for JxlImage

source§

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

Formats the value using the given formatter. 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> 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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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