pub struct Kernel { /* private fields */ }
Expand description
2-dimensional convolution kernel
Implementations
sourceimpl 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
sourceimpl<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
sourcefn 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
sourcefn 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
sourcefn 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 Read more
sourcefn 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
sourcefn 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
sourcefn 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 RefUnwindSafe for Kernel
impl Send for Kernel
impl Sync for Kernel
impl Unpin for Kernel
impl UnwindSafe for Kernel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more