Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/imageops/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ where
///
/// This method typically assumes that the input is scene-linear light.
/// If it is not, color distortion may occur.
pub fn filter3x3<I, P, S>(image: &I, kernel: &[f32]) -> ImageBuffer<P, Vec<S>>
pub fn filter3x3<I, P, S>(image: &I, kernel: &[f32; 9]) -> ImageBuffer<P, Vec<S>>
where
I: GenericImageView<Pixel = P>,
P: Pixel<Subpixel = S> + 'static,
Expand Down
6 changes: 2 additions & 4 deletions src/images/dynimage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1039,15 +1039,13 @@ impl DynamicImage {
///
/// # Arguments
///
/// * `kernel` - slice contains filter. Only slice len is 9 length is accepted.
/// * `kernel` - array contains filter.
///
/// This method typically assumes that the input is scene-linear light. It operates on pixel
/// channel values directly without taking into account color space data. If it is not, color
/// distortion may occur.
#[must_use]
pub fn filter3x3(&self, kernel: &[f32]) -> DynamicImage {
assert_eq!(9, kernel.len(), "filter must be 3 x 3");

pub fn filter3x3(&self, kernel: &[f32; 9]) -> DynamicImage {
dynamic_map!(*self, ref p => imageops::filter3x3(p, kernel))
}

Expand Down
Loading