zplCore.comzplCore.com

SnapshotTolerance

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

SignatureDescription
# SnapshotTolerance()

Properties

PropertyTypeDescription
static Exact { get; }SnapshotTolerancePixel-identical, no content change.
IgnoreContentChanges { get; init; }boolAccept added/removed/changed elements as long as the pixel tolerance holds (default false).
MaxChangedPercent { get; init; }doubleChanged pixels that are accepted, in percent of the label area (0–100).
MaxChangedPixels { get; init; }intChanged pixels that are accepted (absolute).
ShiftPixels { get; init; }intInk that moved by up to this many dots counts as unchanged (anti-jitter for cross-platform font rasterising).

Methods

Method SignatureReturnsDescription
# Allowed(long area)longAllowed changed pixels for a label of area pixels.
static # Percent(double percent)SnapshotToleranceUp to percent % changed pixels.
static # Pixels(int pixels)SnapshotToleranceUp to pixels changed pixels.
# WithShift(int dots)SnapshotToleranceIgnores ink that moved by up to dots dots.