zenjxl_decoder/api/
mod.rs1mod color;
9mod convenience;
10mod data_types;
11mod decoder;
12mod inner;
13mod input;
14#[cfg(feature = "cms")]
15mod moxcms_wrapper;
16mod options;
17mod signature;
18mod xyb_constants;
19
20pub use crate::image::JxlOutputBuffer;
21pub use color::*;
22pub use convenience::{JxlImage, JxlImageInfo, decode, decode_with, read_header, read_header_with};
23pub use data_types::*;
24pub use decoder::*;
25pub use enough::{Stop, Unstoppable};
26pub use inner::*;
27pub use input::*;
28#[cfg(feature = "cms")]
29pub use moxcms_wrapper::*;
30pub use options::*;
31pub use signature::*;
32
33pub use crate::error::{Error, Result};
35
36pub use crate::image::{
38 DataTypeTag, Image, ImageDataType, ImageRect, ImageRectMut, OwnedRawImage, RawImageRect,
39 RawImageRectMut, Rect,
40};
41
42pub use crate::headers::color_encoding::RenderingIntent;
44pub use crate::headers::extra_channels::ExtraChannel;
45pub use crate::headers::image_metadata::Orientation;
46
47pub use crate::container::gain_map::GainMapBundle;
49
50pub use crate::features::spline::Point;
52
53#[cfg(feature = "profiling")]
55pub use crate::util::profiling::print_profile_report;
56
57#[derive(Debug, PartialEq)]
65pub enum ProcessingResult<T, U> {
66 Complete { result: T },
67 NeedsMoreInput { size_hint: usize, fallback: U },
68}
69
70impl<T> ProcessingResult<T, ()> {
71 fn new(
72 result: Result<T, crate::error::Error>,
73 ) -> Result<ProcessingResult<T, ()>, crate::error::Error> {
74 match result {
75 Ok(v) => Ok(ProcessingResult::Complete { result: v }),
76 Err(crate::error::Error::OutOfBounds(v)) => Ok(ProcessingResult::NeedsMoreInput {
77 size_hint: v,
78 fallback: (),
79 }),
80 Err(e) => Err(e),
81 }
82 }
83}
84
85#[derive(Clone)]
86#[non_exhaustive]
87pub struct ToneMapping {
88 pub intensity_target: f32,
89 pub min_nits: f32,
90 pub relative_to_max_display: bool,
91 pub linear_below: f32,
92}
93
94#[derive(Clone)]
95#[non_exhaustive]
96pub struct JxlBasicInfo {
97 pub size: (usize, usize),
98 pub bit_depth: JxlBitDepth,
99 pub orientation: Orientation,
100 pub extra_channels: Vec<JxlExtraChannel>,
101 pub animation: Option<JxlAnimation>,
102 pub uses_original_profile: bool,
103 pub tone_mapping: ToneMapping,
104 pub preview_size: Option<(usize, usize)>,
105 pub intrinsic_size: Option<(usize, usize)>,
111}