zune_hdr/lib.rs
1/*
2 * Copyright (c) 2023.
3 *
4 * This software is free software; You can redistribute it or modify it under terms of the MIT, Apache License or Zlib license
5 */
6
7//! A RADIANCE HDR decoder and encoder
8//!
9//!
10//! # Features
11//! - Minimal interface, few dependencies
12//! - Fast.
13//! - No unsafe
14//! - Fuzz tested decoder
15//!
16//! # Usage notes
17//! The decoder returns data in `&[f32]` types with the exponent already added to the numbers
18//! it does not return raw data nor does it expose the ability to do so.
19//!
20//!
21//! # Metadata
22//! - Radiance images usually store metadata in key value pairs.
23//! During decoding, we extract this metadata from the headers into a hashmap for which we provide
24//! via get_metadata method, the decoder does not in any way interpret the metadata to understand
25//! the image characteristics or colorspace, it is the caller's work to do that.
26//!
27//! Some important metadata include the image colorspace, which may be present or not,
28//! color primaries, exposure,gamma e.t.c,
29//!
30
31// CAE: No std doesn't work because we haven't implemented
32// floor and exp2 for floats, which do not exist in no std land
33// #![no_std]
34#![forbid(unsafe_code)]
35#![macro_use]
36extern crate alloc;
37extern crate core;
38
39pub use decoder::HdrDecoder;
40pub use encoder::HdrEncoder;
41pub use errors::{HdrDecodeErrors, HdrEncodeErrors};
42pub use zune_core;
43
44mod decoder;
45mod encoder;
46mod errors;