oidn 0.2.0

A wrapper for the Intel OpenImageDenoise image denoising library.
docs.rs failed to build oidn-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: oidn-2.2.3

oidn-rs

Crates.io Build Status

Rust bindings to Intel's OpenImageDenoise library.

Documentation

Rust doc can be found here, OpenImageDenoise documentation can be found here.

Example

oidn-rs provides a lightweight wrapper over the OpenImageDenoise library, along with raw C bindings exposed under oidn::sys. Below is an example of using the RT filter from OpenImageDenoise (the RayTracing filter) to denoise an image.

extern crate oidn;

fn main() {
    // Load scene, render image, etc.

    let input_img: Vec<f32> = // Produced by your renderer
    let mut filter_output = vec![0.0f32; input_img.len()];

    let mut device = oidn::Device::new();
    let mut filter = oidn::RayTracing::new(&mut device);
    filter.set_srgb(true)
        .set_img_dims(input.width() as usize, input.height() as usize);
    filter.execute(&input_img[..], &mut filter_output[..]);

    if let Err(e) = device.get_error() {
        println!("Error denosing image: {}", e.1);
    }

    // Save out or display filter_output image
}

See the simple for an example program which loads a JPG, denoises it, and saves the output image to a JPG.