pub struct ConvolutionKernel { /* private fields */ }Expand description
Convolution kernel
Implementations§
Source§impl ConvolutionKernel
impl ConvolutionKernel
Sourcepub fn new(
kernel: Vec<f32>,
width: u32,
height: u32,
normalize: bool,
) -> Result<Self>
pub fn new( kernel: Vec<f32>, width: u32, height: u32, normalize: bool, ) -> Result<Self>
Create a new convolution kernel
§Arguments
kernel- Kernel weights (must be width * height in size)width- Kernel width (must be odd)height- Kernel height (must be odd)normalize- Whether to normalize the kernel
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Get kernel dimensions
Sourcepub fn is_normalized(&self) -> bool
pub fn is_normalized(&self) -> bool
Check if normalization is enabled
Auto Trait Implementations§
impl Freeze for ConvolutionKernel
impl RefUnwindSafe for ConvolutionKernel
impl Send for ConvolutionKernel
impl Sync for ConvolutionKernel
impl Unpin for ConvolutionKernel
impl UnsafeUnpin for ConvolutionKernel
impl UnwindSafe for ConvolutionKernel
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> 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