pub struct Filter<'a> { /* private fields */ }Expand description
Generic filter created by type name (e.g. "RT", "RTLightmap").
Exposes the full OIDN filter API: buffer or shared image/data, progress monitor, async execute.
Implementations§
Source§impl<'a> Filter<'a>
impl<'a> Filter<'a>
Sourcepub fn new(device: &'a OidnDevice, type_name: &str) -> Result<Self, Error>
pub fn new(device: &'a OidnDevice, type_name: &str) -> Result<Self, Error>
Creates a filter of the given type (e.g. "RT", "RTLightmap").
Sourcepub fn set_image(
&self,
name: &str,
buffer: &OidnBuffer,
format: ImageFormat,
width: usize,
height: usize,
byte_offset: usize,
pixel_byte_stride: usize,
row_byte_stride: usize,
)
pub fn set_image( &self, name: &str, buffer: &OidnBuffer, format: ImageFormat, width: usize, height: usize, byte_offset: usize, pixel_byte_stride: usize, row_byte_stride: usize, )
Sets an image parameter from an OIDN buffer.
Sets an image parameter from a raw device pointer (zero-copy). Caller keeps ownership.
Sourcepub fn unset_image(&self, name: &str)
pub fn unset_image(&self, name: &str)
Unsets a previously set image parameter.
Sets an opaque data parameter (host pointer). Caller keeps ownership.
Sourcepub fn update_data(&self, name: &str)
pub fn update_data(&self, name: &str)
Notifies the filter that the contents of an opaque data parameter have changed.
Sourcepub fn unset_data(&self, name: &str)
pub fn unset_data(&self, name: &str)
Unsets a previously set opaque data parameter.
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. Call with (None, null) to clear.
Sourcepub fn commit(&self)
pub fn commit(&self)
Commits all previous filter parameter changes. Must be called before execute.
Sourcepub fn execute(&self)
pub fn execute(&self)
Executes the filter (synchronous). Call device.sync() after if using a GPU device.
Sourcepub fn execute_async(&self)
pub fn execute_async(&self)
Executes the filter asynchronously. Call device.sync() before reading output.
Sourcepub fn device(&self) -> &'a OidnDevice
pub fn device(&self) -> &'a OidnDevice
Underlying device (for sync/error).