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//!
24//! During decoding, we extract this metadata from the headers into a hashmap for which we provide
25//! via get_metadata method, the decoder does not in any way interpret the metadata to understand
26//! the image characteristics or colorspace, it is the caller's work to do that.
27//!
28//! Some important metadata include the image colorspace, which may be present or not,
29//! color primaries, exposure,gamma e.t.c,
30//!
31
32// CAE: No std doesn't work because we haven't implemented
33// floor and exp2 for floats, which do not exist in no std land
34// #![no_std]
35#![forbid(unsafe_code)]
36#![macro_use]
37extern crate alloc;
38extern crate core;
39pub extern crate zune_core;
40pub use decoder::HdrDecoder;
41pub use encoder::HdrEncoder;
42pub use errors::{HdrDecodeErrors, HdrEncodeErrors};
43
44mod decoder;
45mod encoder;
46mod errors;