Struct oidn::RayTracing

source ·
pub struct RayTracing<'a> { /* private fields */ }
Expand description

A generic ray tracing denoising filter for denoising images produces with Monte Carlo ray tracing methods such as path tracing.

Implementations§

source§

impl<'a> RayTracing<'a>

source

pub fn new(device: &'a Device) -> RayTracing<'a>

source

pub fn filter_quality(&mut self, quality: Quality) -> &mut RayTracing<'a>

Sets the quality of the output, the default is high.

Balanced lowers the precision, if possible, however some devices will not support this and so the result (and performance) will stay the same as high. Balanced is recommended for realtime usages.

source

pub fn albedo_normal( &mut self, albedo: &[f32], normal: &[f32] ) -> &mut RayTracing<'a>

Set input auxiliary images containing the albedo and normals.

Albedo must have three channels per pixel with values in [0, 1]. Normal must contain the shading normal as three channels per pixel world-space or view-space vectors with arbitrary length, values in [-1, 1].

source

pub fn albedo(&mut self, albedo: &[f32]) -> &mut RayTracing<'a>

Set an input auxiliary image containing the albedo per pixel (three channels, values in [0, 1]).

source

pub fn hdr(&mut self, hdr: bool) -> &mut RayTracing<'a>

Set whether the color is HDR.

source

pub fn hdr_scale(&mut self, hdr_scale: f32) -> &mut RayTracing<'a>

👎Deprecated since 1.3.1: Please use RayTracing::input_scale instead
source

pub fn input_scale(&mut self, input_scale: f32) -> &mut RayTracing<'a>

Sets a scale to apply to input values before filtering, without scaling the output too.

This can be used to map color or auxiliary feature values to the expected range. E.g. for mapping HDR values to physical units (which affects the quality of the output but not the range of the output values). If not set, the scale is computed implicitly for HDR images or set to 1 otherwise

source

pub fn srgb(&mut self, srgb: bool) -> &mut RayTracing<'a>

Set whether the color is encoded with the sRGB (or 2.2 gamma) curve (LDR only) or is linear.

The output will be encoded with the same curve.

source

pub fn clean_aux(&mut self, clean_aux: bool) -> &mut RayTracing<'a>

Set whether the auxiliary feature (albedo, normal) images are noise-free.

Recommended for highest quality but should not be enabled for noisy auxiliary images to avoid residual noise.

source

pub fn image_dimensions( &mut self, width: usize, height: usize ) -> &mut RayTracing<'a>

source

pub fn filter(&self, color: &[f32], output: &mut [f32]) -> Result<(), Error>

source

pub fn filter_in_place(&self, color: &mut [f32]) -> Result<(), Error>

Trait Implementations§

source§

impl<'a> Drop for RayTracing<'a>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a> Send for RayTracing<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for RayTracing<'a>

§

impl<'a> RefUnwindSafe for RayTracing<'a>

§

impl<'a> !Sync for RayTracing<'a>

§

impl<'a> Unpin for RayTracing<'a>

§

impl<'a> UnwindSafe for RayTracing<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.