pub struct Kernel2d { /* private fields */ }Expand description
Finite 2D convolution kernel stored in row-major order.
Implementations§
Source§impl Kernel2d
impl Kernel2d
Sourcepub fn new(
width: usize,
height: usize,
values: impl Into<Vec<f32>>,
) -> Result<Self>
pub fn new( width: usize, height: usize, values: impl Into<Vec<f32>>, ) -> Result<Self>
Creates a kernel with non-zero dimensions and matching finite values.
Sourcepub fn identity_3x3() -> Self
pub fn identity_3x3() -> Self
Creates a 3x3 identity kernel with a 1.0 center coefficient.
Sourcepub fn sharpen_3x3() -> Self
pub fn sharpen_3x3() -> Self
Creates a standard 3x3 sharpen kernel.
Sourcepub fn as_array_3x3(&self) -> Result<[f32; 9]>
pub fn as_array_3x3(&self) -> Result<[f32; 9]>
Copies a 3x3 kernel into a fixed-size row-major array.
Trait Implementations§
impl StructuralPartialEq for Kernel2d
Auto Trait Implementations§
impl Freeze for Kernel2d
impl RefUnwindSafe for Kernel2d
impl Send for Kernel2d
impl Sync for Kernel2d
impl Unpin for Kernel2d
impl UnsafeUnpin for Kernel2d
impl UnwindSafe for Kernel2d
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