Skip to main content

Module diff

Module diff 

Source
Expand description

Per-region pixel comparison — the logic behind pixelcoords diff.

assert answers “is this point inside a region”; find answers “where did my region go”. Neither answers “do my regions still look the same”, which is visual regression testing over regions a human marked rather than over whole screenshots.

The mask is not computed here. A saved crop already carries its shape in its alpha channel — save::write_crop runs draw::apply_alpha_mask_outside for every kind except an unrotated rect, which is fully opaque and therefore fully in-mask — so rotated and concave regions compare by their own silhouette for free, using the same rule crate::locate::Template matches by.

Structs§

Baseline
A saved crop prepared for comparison: its colour, and the shape mask its alpha channel already carries.
RegionDiff
How much of one region changed.
RegionReport
One region’s comparison, with the identity every report row carries.

Enums§

DiffError

Functions§

compare
Compare a baseline against the same-sized window of frame at at, over the baseline’s mask.
within
Every region within tolerance — the aggregate diff reports as ok.