pub struct JxlImage { /* private fields */ }
Expand description
JPEG XL image.
Implementations§
source§impl JxlImage
impl JxlImage
sourcepub fn builder() -> JxlImageBuilder
pub fn builder() -> JxlImageBuilder
Creates a decoder builder with default options.
sourcepub fn feed_bytes(&mut self, buf: &[u8]) -> Result<()>
pub fn feed_bytes(&mut self, buf: &[u8]) -> Result<()>
Feeds more data into the decoder.
source§impl JxlImage
impl JxlImage
sourcepub fn image_header(&self) -> &ImageHeader
pub fn image_header(&self) -> &ImageHeader
Returns the image header.
sourcepub fn set_cms(
&mut self,
cms: impl ColorManagementSystem + Send + Sync + 'static,
)
pub fn set_cms( &mut self, cms: impl ColorManagementSystem + Send + Sync + 'static, )
Sets color management system implementation to be used by the renderer.
sourcepub fn original_icc(&self) -> Option<&[u8]>
pub fn original_icc(&self) -> Option<&[u8]>
Returns the original ICC profile embedded in the image.
sourcepub fn rendered_icc(&self) -> Vec<u8>
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
.
sourcepub fn rendered_cicp(&self) -> Option<[u8; 4]>
pub fn rendered_cicp(&self) -> Option<[u8; 4]>
Returns the CICP tag of the color encoding of rendered images, if there’s any.
sourcepub fn pixel_format(&self) -> PixelFormat
pub fn pixel_format(&self) -> PixelFormat
Returns the pixel format of the rendered image.
sourcepub fn request_icc(&mut self, icc_profile: &[u8]) -> Result<()>
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.
sourcepub fn request_color_encoding(&mut self, color_encoding: EnumColourEncoding)
pub fn request_color_encoding(&mut self, color_encoding: EnumColourEncoding)
Requests the decoder to render in specific color encoding, described by
EnumColourEncoding
.
sourcepub fn render_spot_color(&self) -> bool
pub fn render_spot_color(&self) -> bool
Returns whether the spot color channels will be rendered.
sourcepub fn set_render_spot_color(&mut self, render_spot_color: bool) -> &mut Self
pub fn set_render_spot_color(&mut self, render_spot_color: bool) -> &mut Self
Sets whether the spot colour channels will be rendered.
pub fn set_image_region(&mut self, region: CropInfo) -> &mut Self
source§impl JxlImage
impl JxlImage
sourcepub fn num_loaded_keyframes(&self) -> usize
pub fn num_loaded_keyframes(&self) -> usize
Returns the number of currently loaded keyframes.
sourcepub fn num_loaded_frames(&self) -> usize
pub fn num_loaded_frames(&self) -> usize
Returns the number of currently loaded frames, including frames that are not displayed directly.
sourcepub fn is_loading_done(&self) -> bool
pub fn is_loading_done(&self) -> bool
Returns whether the image is loaded completely, without missing animation keyframes or partially loaded frames.
sourcepub fn frame_by_keyframe(&self, keyframe_index: usize) -> Option<&IndexedFrame>
pub fn frame_by_keyframe(&self, keyframe_index: usize) -> Option<&IndexedFrame>
Returns frame data by keyframe index.
sourcepub fn frame_header(&self, keyframe_index: usize) -> Option<&FrameHeader>
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.
sourcepub fn frame(&self, frame_idx: usize) -> Option<&IndexedFrame>
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.
sourcepub fn frame_offset(&self, frame_index: usize) -> Option<usize>
pub fn frame_offset(&self, frame_index: usize) -> Option<usize>
Returns the offset of frame within codestream, in bytes.
source§impl JxlImage
impl JxlImage
sourcepub fn render_frame(&self, keyframe_index: usize) -> Result<Render>
pub fn render_frame(&self, keyframe_index: usize) -> Result<Render>
Renders the given keyframe.
sourcepub fn render_frame_cropped(&self, keyframe_index: usize) -> Result<Render>
pub fn render_frame_cropped(&self, keyframe_index: usize) -> Result<Render>
Renders the given keyframe with optional cropping region.
sourcepub fn render_loading_frame(&mut self) -> Result<Render>
pub fn render_loading_frame(&mut self) -> Result<Render>
Renders the currently loading keyframe.
sourcepub fn render_loading_frame_cropped(&mut self) -> Result<Render>
pub fn render_loading_frame_cropped(&mut self) -> Result<Render>
Renders the currently loading keyframe with optional cropping region.
source§impl JxlImage
impl JxlImage
sourcepub fn pool(&self) -> &JxlThreadPool
pub fn pool(&self) -> &JxlThreadPool
Returns the thread pool used by the renderer.
sourcepub fn reader(&self) -> &ContainerDetectingReader
pub fn reader(&self) -> &ContainerDetectingReader
Returns the internal reader.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for JxlImage
impl !RefUnwindSafe for JxlImage
impl Send for JxlImage
impl Sync for JxlImage
impl Unpin for JxlImage
impl !UnwindSafe for JxlImage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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