Skip to main content

RtLightmapFilter

Struct RtLightmapFilter 

Source
pub struct RtLightmapFilter<'a> { /* private fields */ }
Expand description

Ray-traced lightmap denoising filter (OIDN “RTLightmap”).

Use for denoising baked lightmaps. Requires OIDN built with OIDN_FILTER_RTLIGHTMAP.

Implementations§

Source§

impl<'a> RtLightmapFilter<'a>

Source

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

Creates a new RTLightmap filter. Returns an error if OIDN was not built with RTLightmap support.

Source

pub fn set_dimensions(&mut self, width: u32, height: u32) -> &mut Self

Image dimensions (must be set before execute).

Source

pub fn set_directional(&mut self, directional: bool) -> &mut Self

If true, use directional lightmap model; if false, HDR. Default: false.

Source

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

Gets a boolean filter parameter (e.g. "directional").

Source

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

Gets an integer filter parameter.

Source

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

Gets a float filter 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 execute_in_place(&self, color: &mut [f32]) -> Result<(), Error>

Denoises lightmap in-place. color must be width * height * 3 floats (RGB).

Source

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

Denoises lightmap: reads from color (if provided) or uses output as input, writes to output. All buffers must be width * height * 3 floats (RGB).

Trait Implementations§

Source§

impl Debug for RtLightmapFilter<'_>

Source§

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

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

impl Drop for RtLightmapFilter<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for RtLightmapFilter<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for RtLightmapFilter<'a>

§

impl<'a> RefUnwindSafe for RtLightmapFilter<'a>

§

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

§

impl<'a> Unpin for RtLightmapFilter<'a>

§

impl<'a> UnwindSafe for RtLightmapFilter<'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,