pub trait Filter<T: Type, C: Color, U: Type = T, D: Color = C>: Debug + Sync {
// Required method
fn compute_at(
&self,
pt: Point,
input: &Input<'_, T, C>,
dest: &mut DataMut<'_, U, D>
);
// Provided methods
fn schedule(&self) -> Schedule { ... }
fn output_size(
&self,
_input: &Input<'_, T, C>,
dest: &mut Image<U, D>
) -> Size { ... }
fn eval_partial(
&self,
roi: Region,
input: &[&Image<T, C>],
output: &mut Image<U, D>
) { ... }
fn eval_partial_in_place(&self, roi: Region, output: &mut Image<U, D>) { ... }
fn eval(&self, input: &[&Image<T, C>], output: &mut Image<U, D>) { ... }
fn eval_in_place(&self, output: &mut Image<U, D>) { ... }
}
Expand description
Filters are used to manipulate images in a generic, composable manner
Required Methods§
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
pt
: Current output pointinput
: Input images, input pixel from previous filters in chaindest
: Single pixel output buffer
Provided Methods§
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 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
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