Top |
bool | igt_frame_dump_is_enabled () |
void | igt_write_compared_frames_to_png () |
bool | igt_check_analog_frame_match () |
This library contains helpers for frame-related tests. This includes common frame dumping as well as frame comparison helpers.
bool
igt_frame_dump_is_enabled (void
);
Get whether frame dumping is enabled.
void igt_write_compared_frames_to_png (cairo_surface_t *reference
,cairo_surface_t *capture
,const char *reference_suffix
,const char *capture_suffix
);
Write previously compared frames to png files.
bool igt_check_analog_frame_match (cairo_surface_t *reference
,cairo_surface_t *capture
);
Checks that the analog image contained in the chamelium frame dump matches the given framebuffer.
In order to determine whether the frame matches the reference, the following reasoning is implemented:
The absolute error for each color value of the reference is collected.
The average absolute error is calculated for each color value of the reference and must not go above 60 (23.5 % of the total range).
A linear fit for the average absolute error from the pixel value is calculated, as a DAC-ADC chain is expected to have a linear error curve.
The linear fit is correlated with the actual average absolute error for the frame and the correlation coefficient is checked to be > 0.985, indicating a match with the expected error trend.
Most errors (e.g. due to scaling, rotation, color space, etc) can be reliably detected this way, with a minimized number of false-positives. However, the brightest values (250 and up) are ignored as the error trend is often not linear there in practice due to clamping.