fn compare_to_truth_with_tolerance<P, F>(
    input_file_name: &str,
    truth_file_name: &str,
    op: F,
    tol: u8,
) where
    P: Pixel<Subpixel = u8> + 'static,
    ImageBuffer<P, Vec<u8>>: FromDynamic,
    F: Fn(&ImageBuffer<P, Vec<u8>>) -> ImageBuffer<P, Vec<u8>>,
{
    let input = ImageBuffer::<P, Vec<u8>>::from_dynamic(&load_image_or_panic(
        Path::new(INPUT_DIR).join(input_file_name),
    ));
    let actual = op.call((&input,));
    compare_to_truth_image_with_tolerance(&actual, truth_file_name, tol);
}
/// Loads an input image, applies a function to it and checks that the result
/// matches a 'truth' image to within a given per-pixel tolerance.
Loads an input image, applies a function to it and checks that the result
matches a 'truth' image to within a given per-pixel tolerance.
Loads an input image applies a function to it and checks that the result matches a ' truth ' image to within a given per - pixel tolerance .
fn compare_to_truth_with_tolerance<P, F>(
    input_file_name: &str,
    truth_file_name: &str,
    op: F,
    tol: u8,
) where
    P: Pixel<Subpixel = u8> + 'static,
    ImageBuffer<P, Vec<u8>>: FromDynamic,
    F: Fn(&ImageBuffer<P, Vec<u8>>) -> ImageBuffer<P, Vec<u8>>,
{
    let input = ImageBuffer::<P, Vec<u8>>::from_dynamic(&load_image_or_panic(
        Path::new(INPUT_DIR).join(input_file_name),
    ));
    let actual = op.call((&input,));
    compare_to_truth_image_with_tolerance(&actual, truth_file_name, tol);
}
fn compare_to_truth_with_tolerance < P , F > ( input_file_name : & str , truth_file_name : & str , op : F , tol : u8 , ) where P : Pixel < Subpixel = u8 > + ' static , ImageBuffer < P , Vec < u8 > > : FromDynamic , F : Fn ( & ImageBuffer < P , Vec < u8 > > ) -> ImageBuffer < P , Vec < u8 > > , { let input = ImageBuffer :: < P , Vec < u8 > > :: from_dynamic ( & load_image_or_panic ( Path :: new ( INPUT_DIR ) . join ( input_file_name ) , ) ) ; let actual = op . call ( ( & input , ) ) ; compare_to_truth_image_with_tolerance ( & actual , truth_file_name , tol ) ; }
Loads an input image, applies a function to it and checks that the result
matches a 'truth' image to within a given per-pixel tolerance.
Loads an input image applies a function to it and checks that the result matches a ' truth ' image to within a given per - pixel tolerance .
input_file_name
&str
truth_file_name
&str
op
F
tol
u8
input_file_name
&str
truth_file_name
&str
op
F
tol
u8