Enum wgpu_test::image::ComparisonType
source · pub enum ComparisonType {
Mean(f32),
Percentile {
percentile: f32,
threshold: f32,
},
}
Expand description
The FLIP library generates a per-pixel error map where 0.0 represents “no error” and 1.0 represents “maximum error” between the images. This is then put into a weighted-histogram, which we query to determine if the errors between the test and reference image is high enough to count as “different”.
Error thresholds will be different for every test, but good initial values to look at are in the [0.01, 0.1] range. The larger the area that might have inherent variance, the larger this base value is. Using a high percentile comparison (e.g. 95% or 99%) is good for images that are likely to have a lot of error in a small area when they fail.
Variants§
Mean(f32)
If the mean error is greater than the given value, the test will fail.
Percentile
If the given percentile is greater than the given value, the test will fail.
The percentile is given in the range [0, 1].
Trait Implementations§
source§impl Clone for ComparisonType
impl Clone for ComparisonType
source§fn clone(&self) -> ComparisonType
fn clone(&self) -> ComparisonType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more