image-rs / imageproc

Image processing operations
MIT License
758 stars 149 forks source link

Use `Kernel` by `ref` #652

Closed cospectrum closed 5 months ago

cospectrum commented 5 months ago

Maybe filter_clamped and friends should use Kernel via ref instead of move?

cospectrum commented 5 months ago

I think it will work fine. This code compiles, for example

fn main() {
    take_ref(&Kernel::new(&[1, 2, 3, 4], 2, 2));
}

fn take_ref<T>(kernel: &Kernel<T>) {
}
cospectrum commented 5 months ago

Oh, no, I'm wrong. No problems with move, since we derived Copy. Cool