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