Trait Filter
Source pub trait Filter:
Send
+ Sync
+ 'static {
// Required method
fn test(&self, pixel: &Rgba) -> bool;
// Provided method
fn composite<F>(self, other: F) -> CompositeFilter<Self, F>
where Self: Sized,
F: Filter { ... }
}
Expand description
A trait for filtering pixels in an image.
Tests whether a pixel passes the filter.
§Arguments
pixel - The pixel to apply the filter to.
§Returns
true if the pixel passes the filter; false otherwise.
Composites this filter with another filter.
§Type Parameters
F - The type of the filter to compose with.
§Arguments
other - The other filter to compose with.
§Returns
A new filter that applies this filter and then the given filter.
Source§A filter that applies a closure to a pixel.
This filter is useful for creating custom filters that can be passed to the apply method.
§Type Parameters
F - The type of the closure.