pub struct DenoiseKernel { /* private fields */ }Expand description
Denoise kernel configuration for use with the kernels module.
Implementations§
Source§impl DenoiseKernel
impl DenoiseKernel
Sourcepub fn new(algorithm: DenoiseAlgorithm) -> Self
pub fn new(algorithm: DenoiseAlgorithm) -> Self
Create a new denoise kernel with the given algorithm.
Sourcepub fn bilateral(sigma_spatial: f32, sigma_range: f32) -> Self
pub fn bilateral(sigma_spatial: f32, sigma_range: f32) -> Self
Create a bilateral filter denoise kernel.
Sourcepub fn nlm(h: f32, patch_radius: u32, search_radius: u32) -> Self
pub fn nlm(h: f32, patch_radius: u32, search_radius: u32) -> Self
Create an NLM denoise kernel.
Sourcepub fn apply(
&self,
device: &GpuDevice,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
) -> Result<()>
pub fn apply( &self, device: &GpuDevice, input: &[u8], output: &mut [u8], width: u32, height: u32, ) -> Result<()>
Apply this kernel to an RGBA image.
§Errors
Returns an error if buffer sizes are invalid or the operation fails.
Sourcepub fn algorithm(&self) -> DenoiseAlgorithm
pub fn algorithm(&self) -> DenoiseAlgorithm
Get the algorithm used by this kernel.
Sourcepub fn estimate_gflops(&self, width: u32, height: u32) -> f64
pub fn estimate_gflops(&self, width: u32, height: u32) -> f64
Estimate GFLOP for width × height frame at this algorithm.
Trait Implementations§
Source§impl Clone for DenoiseKernel
impl Clone for DenoiseKernel
Source§fn clone(&self) -> DenoiseKernel
fn clone(&self) -> DenoiseKernel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DenoiseKernel
impl RefUnwindSafe for DenoiseKernel
impl Send for DenoiseKernel
impl Sync for DenoiseKernel
impl Unpin for DenoiseKernel
impl UnsafeUnpin for DenoiseKernel
impl UnwindSafe for DenoiseKernel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more