pub struct DenoiseOperation;Expand description
GPU-accelerated denoise operations.
§Note on GPU vs CPU execution
When a real GPU device is available, compute shaders run on the device. This implementation provides CPU SIMD fallback paths for all algorithms that activate automatically if no GPU is detected. The fallback uses rayon for multi-threaded execution.
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
Mutably borrows from an owned value. Read more
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