3 unstable releases

0.3.0 Apr 7, 2021
0.2.1 Feb 27, 2021
0.2.0 Feb 25, 2021

#596 in Images

Download history 7/week @ 2023-12-10 1/week @ 2023-12-31 9/week @ 2024-01-07 22/week @ 2024-02-18 57/week @ 2024-02-25 20/week @ 2024-03-03 21/week @ 2024-03-10 12/week @ 2024-03-17

110 downloads per month

WTFPL license

6.5MB
393 lines

Radiant

Load Radiance HDR (.hdr, .pic) images.

This is a fork of TechPriest’s HdrLdr, rewritten for slightly better performance. May or may not actually perform better. I've restricted the API so that it only accepts readers that implement BufRead.

The original crate, which does not have this restriction, is in turn a slightly rustified version of C++ code by IgorKravtchenko. If you need more image formats besides HDR, take a look at Image2crate.

Example

Add radiant to your dependencies of your Cargo.toml:

[dependencies]
radiant = "0.2"

And then, in your rust file:

use std::io::BufReader;
use std::fs::File;

let f = File::open("assets/colorful_studio_2k.hdr").expect("Failed to open specified file");
let f = BufReader::new(f);
let image = radiant::load(f).expect("Failed to load image data");

For more complete example, see Simple HDR Viewer application

Huge thanks to HDRI Haven for providing CC0 sample images for testing!

Dependencies