Expand description
Rust bindings to Intel’s Open Image Denoise.
Open Image Denoise documentation can be found here.
§Example
The crate provides a lightweight wrapper over the Open Image Denoise
library, along with raw C bindings exposed under oidn::sys. Below
is an example of using the the RayTracing filter to denoise an image.
ⓘ
// Load scene, render image, etc.
let input_img: Vec<f32> = // A float3 RGB image produced by your renderer.
let mut filter_output = vec![0.0f32; input_img.len()];
let device = oidn::Device::new().expect("failed to create an OIDN device");
oidn::RayTracing::try_new(&device)
.expect("Failed to create the filter")
// Optionally add float3 normal and albedo buffers as well.
.srgb(true)
.image_dimensions(input.width() as usize, input.height() as usize)
.filter(&input_img[..], &mut filter_output[..])
.expect("Filter config error!");
// Save out or display filter_output image.Modules§
Structs§
- Buffer
- Device
- An Open Image Denoise device (e.g. a CPU).
- Error
- A failure reported by Open Image Denoise, or by this crate’s own argument checks.
- External
Memory Type Flags - External memory handle types supported by Open Image Denoise.
- External
Semaphore Type Flags - External semaphore handle types supported by Open Image Denoise.
- Pending
Buffer Read - Completion guard for an asynchronous OIDN buffer read.
- Pending
Buffer Write - Completion guard for an asynchronous OIDN buffer write.
- Pending
Filter - Completion guard for an asynchronous OIDN filter execution.
- RayTracing
- A generic ray tracing denoising filter for denoising images produces with Monte Carlo ray tracing methods such as path tracing.
- Semaphore
- An external semaphore imported from a graphics API.