pub struct DenoiseOperation;Expand description
GPU-accelerated denoise operations.
§Note on GPU vs CPU execution
When a real GPU device is available (!device.is_fallback), the bilateral
filter runs as a wgpu compute shader (bilateral_filter_main entry point in
shaders/bilateral.wgsl). If the GPU path fails at any point, execution
transparently falls back to the CPU SIMD implementation.
Gaussian and NLM always use the CPU path (NLM GPU path is planned for a future release).
Implementations§
Source§impl DenoiseOperation
impl DenoiseOperation
Sourcepub fn denoise(
device: &GpuDevice,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
algorithm: DenoiseAlgorithm,
) -> Result<()>
pub fn denoise( device: &GpuDevice, input: &[u8], output: &mut [u8], width: u32, height: u32, algorithm: DenoiseAlgorithm, ) -> Result<()>
Denoise an RGBA image using the selected algorithm.
Both input and output must be width * height * 4 bytes
(packed RGBA, one byte per channel).
§Errors
Returns an error if buffer sizes are invalid.
Sourcepub fn auto_denoise(
device: &GpuDevice,
input: &[u8],
output: &mut [u8],
width: u32,
height: u32,
noise_level: f32,
) -> Result<()>
pub fn auto_denoise( device: &GpuDevice, input: &[u8], output: &mut [u8], width: u32, height: u32, noise_level: f32, ) -> Result<()>
Convenience: Gaussian denoise with automatic sigma selection.
noise_level is in the range [0.0, 1.0] where 0.0 = no noise
and 1.0 = heavy noise.
§Errors
Returns an error if buffer sizes are invalid.
Auto Trait Implementations§
impl Freeze for DenoiseOperation
impl RefUnwindSafe for DenoiseOperation
impl Send for DenoiseOperation
impl Sync for DenoiseOperation
impl Unpin for DenoiseOperation
impl UnsafeUnpin for DenoiseOperation
impl UnwindSafe for DenoiseOperation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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