Skip to main content

Filter

Struct Filter 

Source
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>

Source

pub fn new(device: &'a OidnDevice, type_name: &str) -> Result<Self, Error>

Creates a filter of the given type (e.g. "RT", "RTLightmap").

Source

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.

Source

pub unsafe fn set_shared_image( &self, name: &str, dev_ptr: *mut c_void, format: ImageFormat, width: usize, height: usize, byte_offset: usize, pixel_byte_stride: usize, row_byte_stride: usize, )

Sets an image parameter from a raw device pointer (zero-copy). Caller keeps ownership.

Source

pub fn unset_image(&self, name: &str)

Unsets a previously set image parameter.

Source

pub unsafe fn set_shared_data( &self, name: &str, host_ptr: *mut c_void, byte_size: usize, )

Sets an opaque data parameter (host pointer). Caller keeps ownership.

Source

pub fn update_data(&self, name: &str)

Notifies the filter that the contents of an opaque data parameter have changed.

Source

pub fn unset_data(&self, name: &str)

Unsets a previously set opaque data parameter.

Source

pub fn set_bool(&self, name: &str, value: bool)

Sets a boolean parameter.

Source

pub fn get_bool(&self, name: &str) -> bool

Gets a boolean parameter.

Source

pub fn set_int(&self, name: &str, value: i32)

Sets an integer parameter.

Source

pub fn get_int(&self, name: &str) -> i32

Gets an integer parameter.

Source

pub fn set_float(&self, name: &str, value: f32)

Sets a float parameter.

Source

pub fn get_float(&self, name: &str) -> f32

Gets a float parameter.

Source

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.

Source

pub fn commit(&self)

Commits all previous filter parameter changes. Must be called before execute.

Source

pub fn execute(&self)

Executes the filter (synchronous). Call device.sync() after if using a GPU device.

Source

pub fn execute_async(&self)

Executes the filter asynchronously. Call device.sync() before reading output.

Source

pub fn device(&self) -> &'a OidnDevice

Underlying device (for sync/error).

Source

pub fn retain(&self)

Retains the filter (increments OIDN reference count). For advanced interop when sharing the filter.

Trait Implementations§

Source§

impl Debug for Filter<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Filter<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Filter<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for Filter<'a>

§

impl<'a> RefUnwindSafe for Filter<'a>

§

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

§

impl<'a> Unpin for Filter<'a>

§

impl<'a> UnwindSafe for Filter<'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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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>,

Source§

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>,

Source§

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,