mod color;
mod convenience;
mod data_types;
mod decoder;
mod inner;
mod input;
#[cfg(feature = "cms")]
mod moxcms_wrapper;
mod options;
mod signature;
mod xyb_constants;
pub use crate::image::JxlOutputBuffer;
pub use color::*;
pub use convenience::{JxlImage, JxlImageInfo, decode, decode_with, read_header, read_header_with};
pub use data_types::*;
pub use decoder::*;
pub use enough::{Stop, Unstoppable};
pub use inner::*;
pub use input::*;
#[cfg(feature = "cms")]
pub use moxcms_wrapper::*;
pub use options::*;
pub use signature::*;
pub use crate::error::{Error, Result};
pub use crate::image::{
DataTypeTag, Image, ImageDataType, ImageRect, ImageRectMut, OwnedRawImage, RawImageRect,
RawImageRectMut, Rect,
};
pub use crate::headers::color_encoding::RenderingIntent;
pub use crate::headers::extra_channels::ExtraChannel;
pub use crate::headers::image_metadata::Orientation;
pub use crate::container::gain_map::GainMapBundle;
pub use crate::features::spline::Point;
#[cfg(feature = "profiling")]
pub use crate::util::profiling::print_profile_report;
#[derive(Debug, PartialEq)]
pub enum ProcessingResult<T, U> {
Complete { result: T },
NeedsMoreInput { size_hint: usize, fallback: U },
}
impl<T> ProcessingResult<T, ()> {
fn new(
result: Result<T, crate::error::Error>,
) -> Result<ProcessingResult<T, ()>, crate::error::Error> {
match result {
Ok(v) => Ok(ProcessingResult::Complete { result: v }),
Err(crate::error::Error::OutOfBounds(v)) => Ok(ProcessingResult::NeedsMoreInput {
size_hint: v,
fallback: (),
}),
Err(e) => Err(e),
}
}
}
#[derive(Clone)]
#[non_exhaustive]
pub struct ToneMapping {
pub intensity_target: f32,
pub min_nits: f32,
pub relative_to_max_display: bool,
pub linear_below: f32,
}
#[derive(Clone)]
#[non_exhaustive]
pub struct JxlBasicInfo {
pub size: (usize, usize),
pub bit_depth: JxlBitDepth,
pub orientation: Orientation,
pub extra_channels: Vec<JxlExtraChannel>,
pub animation: Option<JxlAnimation>,
pub uses_original_profile: bool,
pub tone_mapping: ToneMapping,
pub preview_size: Option<(usize, usize)>,
pub intrinsic_size: Option<(usize, usize)>,
}