pub struct RtFilter<'a> { /* private fields */ }Expand description
Ray tracing denoising filter (OIDN “RT” filter).
Denoises a beauty (color) image, optionally using albedo and normal AOVs. Reuse the same filter for multiple frames when dimensions match.
Implementations§
Source§impl<'a> RtFilter<'a>
impl<'a> RtFilter<'a>
Sourcepub fn new(device: &'a OidnDevice) -> Result<Self, Error>
pub fn new(device: &'a OidnDevice) -> Result<Self, Error>
Creates a new RT filter. Reuse the same filter for multiple frames when dimensions match.
§Errors
Returns Error::FilterCreationFailed if the RT filter type is not available, or the
device’s last error (e.g. Error::OidnError).
Sourcepub fn set_dimensions(&mut self, width: u32, height: u32) -> &mut Self
pub fn set_dimensions(&mut self, width: u32, height: u32) -> &mut Self
Image dimensions (must be set before execute).
Sourcepub fn set_srgb(&mut self, srgb: bool) -> &mut Self
pub fn set_srgb(&mut self, srgb: bool) -> &mut Self
Whether the input is sRGB (LDR). Default: false.
Sourcepub fn set_clean_aux(&mut self, clean: bool) -> &mut Self
pub fn set_clean_aux(&mut self, clean: bool) -> &mut Self
Whether albedo/normal are noise-free (prefiltered). Default: false.
Sourcepub fn set_input_scale(&mut self, scale: f32) -> &mut Self
pub fn set_input_scale(&mut self, scale: f32) -> &mut Self
Input scale (e.g. for HDR). NaN = auto.
Sourcepub fn set_quality(&mut self, quality: Quality) -> &mut Self
pub fn set_quality(&mut self, quality: Quality) -> &mut Self
Filter quality. Default: High.
Sourcepub fn get_bool(&self, name: &str) -> bool
pub fn get_bool(&self, name: &str) -> bool
Gets a boolean filter parameter (e.g. "hdr", "srgb").
Sourcepub unsafe fn set_progress_monitor_raw(
&self,
func: Option<unsafe extern "C" fn(user_ptr: *mut c_void, n: f64) -> bool>,
user_ptr: *mut c_void,
)
pub unsafe fn set_progress_monitor_raw( &self, func: Option<unsafe extern "C" fn(user_ptr: *mut c_void, n: f64) -> bool>, user_ptr: *mut c_void, )
Sets the progress monitor callback. Callback receives progress in [0,1]; return false to cancel.
Safe to call with (None, null) to clear. Callback must not panic.
Sourcepub fn execute_in_place(&self, color: &mut [f32]) -> Result<(), Error>
pub fn execute_in_place(&self, color: &mut [f32]) -> Result<(), Error>
Denoises color in-place. color must be width * height * 3 floats (RGB).
§Errors
Returns Error::InvalidDimensions if dimensions are unset or buffer sizes do not match,
or an OIDN error from the device.
Sourcepub fn execute_in_place_with_aux(
&self,
color: &mut [f32],
albedo: Option<&[f32]>,
normal: Option<&[f32]>,
) -> Result<(), Error>
pub fn execute_in_place_with_aux( &self, color: &mut [f32], albedo: Option<&[f32]>, normal: Option<&[f32]>, ) -> Result<(), Error>
Denoises color in-place with optional albedo and normal AOVs (each width * height * 3 floats).