pub struct Kernel { /* private fields */ }
Expand description
2-dimensional convolution kernel
Implementations§
Source§impl Kernel
impl Kernel
Sourcepub fn new(rows: usize, cols: usize) -> Kernel
pub fn new(rows: usize, cols: usize) -> Kernel
Create a new kernel with the given number of rows and columns
Sourcepub fn create<F: Fn(usize, usize) -> f64>(
rows: usize,
cols: usize,
f: F,
) -> Kernel
pub fn create<F: Fn(usize, usize) -> f64>( rows: usize, cols: usize, f: F, ) -> Kernel
Create a new kernel and fill it by executing f
with each possible (row, col) pair
Sourcepub fn gaussian_3x3() -> Kernel
pub fn gaussian_3x3() -> Kernel
3x3 pixel gaussian blur
Sourcepub fn gaussian_5x5() -> Kernel
pub fn gaussian_5x5() -> Kernel
5x5 pixel gaussian blur
Sourcepub fn gaussian_7x7() -> Kernel
pub fn gaussian_7x7() -> Kernel
7x7 pixel gaussian blur
Sourcepub fn gaussian_9x9() -> Kernel
pub fn gaussian_9x9() -> Kernel
9x9 pixel gaussian blur
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Kernel
impl<'de> Deserialize<'de> for Kernel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Type, C: Color, U: Type, D: Color> Filter<T, C, U, D> for Kernel
impl<T: Type, C: Color, U: Type, D: Color> Filter<T, C, U, D> for Kernel
Source§fn schedule(&self) -> Schedule
fn schedule(&self) -> Schedule
Determines whether a filter should be executed one pixel at a time, or a whole image at a time
Source§fn compute_at(
&self,
pt: Point,
input: &Input<'_, T, C>,
dest: &mut DataMut<'_, U, D>,
)
fn compute_at( &self, pt: Point, input: &Input<'_, T, C>, dest: &mut DataMut<'_, U, D>, )
Compute filter at the given point for the provided input Read more
Source§fn output_size(&self, _input: &Input<'_, T, C>, dest: &mut Image<U, D>) -> Size
fn output_size(&self, _input: &Input<'_, T, C>, dest: &mut Image<U, D>) -> Size
Get filter output size, this is typically the destination image size, however when used as
part of a pipeline a single filter might have a different output size
Source§fn eval_partial(
&self,
roi: Region,
input: &[&Image<T, C>],
output: &mut Image<U, D>,
)
fn eval_partial( &self, roi: Region, input: &[&Image<T, C>], output: &mut Image<U, D>, )
Evaluate a filter on part of an image
Source§fn eval_partial_in_place(&self, roi: Region, output: &mut Image<U, D>)
fn eval_partial_in_place(&self, roi: Region, output: &mut Image<U, D>)
Evaluate filter on part of an image using the same image for input and output
Source§fn eval_in_place(&self, output: &mut Image<U, D>)
fn eval_in_place(&self, output: &mut Image<U, D>)
Evaluate filter using the same image for input and output
impl StructuralPartialEq for Kernel
Auto Trait Implementations§
impl Freeze for Kernel
impl RefUnwindSafe for Kernel
impl Send for Kernel
impl Sync for Kernel
impl Unpin for Kernel
impl UnwindSafe for Kernel
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, C, U, D, F> FilterExt<T, C, U, D> for F
impl<T, C, U, D, F> FilterExt<T, C, U, D> for F
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