public record SnapshotTolerance
How much a rendered label may differ from its approved snapshot. A label passes when the changed pixels (after ignoring ink that moved by at most SnapshotTolerance.ShiftPixels) are at most SnapshotTolerance.MaxChangedPixels or at most SnapshotTolerance.MaxChangedPercent % of the label area – and, unless SnapshotTolerance.IgnoreContentChanges, when no element was added, removed or changed its text/data (a changed digit can be a handful of pixels, but it is never "noise").
Constructors
| Signature | Description |
# SnapshotTolerance() | |
Properties
| Property | Type | Description |
static Exact { get; } | SnapshotTolerance | Pixel-identical, no content change. |
IgnoreContentChanges { get; init; } | bool | Accept added/removed/changed elements as long as the pixel tolerance holds (default false). |
MaxChangedPercent { get; init; } | double | Changed pixels that are accepted, in percent of the label area (0–100). |
MaxChangedPixels { get; init; } | int | Changed pixels that are accepted (absolute). |
ShiftPixels { get; init; } | int | Ink that moved by up to this many dots counts as unchanged (anti-jitter for cross-platform font rasterising). |
Methods
| Method Signature | Returns | Description |
# Allowed(long area) | long | Allowed changed pixels for a label of area pixels. |
static # Percent(double percent) | SnapshotTolerance | Up to percent % changed pixels. |
static # Pixels(int pixels) | SnapshotTolerance | Up to pixels changed pixels. |
# WithShift(int dots) | SnapshotTolerance | Ignores ink that moved by up to dots dots. |