Skip to main content

zenjxl_decoder/
lib.rs

1// Copyright (c) the JPEG XL Project Authors. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file.
5
6#![cfg_attr(not(feature = "allow-unsafe"), forbid(unsafe_code))]
7#![cfg_attr(feature = "allow-unsafe", deny(unsafe_code))]
8// Internal modules expose items that are used across the crate but not
9// externally.  Some items are kept for future use (container, color TFs,
10// render stages) — suppress dead-code noise so clippy -D warnings passes.
11#![allow(dead_code, unused_imports)]
12
13pub mod api;
14pub use api::{decode, decode_with, read_header, read_header_with};
15pub(crate) mod bit_reader;
16pub(crate) mod color;
17pub(crate) mod container;
18pub(crate) mod entropy_coding;
19pub(crate) mod error;
20pub(crate) mod features;
21pub(crate) mod frame;
22pub(crate) mod headers;
23pub(crate) mod icc;
24pub(crate) mod image;
25pub(crate) mod render;
26pub(crate) mod transforms;
27pub(crate) mod util;
28
29#[cfg(feature = "jpeg")]
30pub(crate) mod jpeg;
31
32#[cfg(test)]
33mod tests;
34
35// TODO: Move these to a more appropriate location.
36const GROUP_DIM: usize = 256;
37const BLOCK_DIM: usize = 8;
38const BLOCK_SIZE: usize = BLOCK_DIM * BLOCK_DIM;
39#[allow(clippy::excessive_precision)]
40const MIN_SIGMA: f32 = -3.90524291751269967465540850526868;