TPDFVisualCompareOptions
Data types, document comparison, rendering
Description
TPDFVisualCompareOptions controls how CompareRenderedPagesWith and CompareDocumentVisualsWith compare two rendered pages. The record is passed by value, so a call never retains it.
Start from PLDefaultVisualCompareOptions, which sets ColorTolerance to 0, TileSize to 32 and leaves IgnoreRects empty, IncludeMask and IncludeOverlay False.
Syntax
Delphi
TPDFVisualCompareOptions = record
ColorTolerance: Byte;
TileSize: Integer;
IgnoreRects: TPDFVisualRectArray;
IncludeMask, IncludeOverlay: Boolean;
end;Fields
| ColorTolerance | Largest absolute per-channel difference, 0 through 255, that still counts as unchanged; 0 requires identical channels |
|---|---|
| TileSize | Edge length in pixels of the tiles that group changed pixels into regions; must be positive |
| IgnoreRects | Top-left-origin, half-open pixel rectangles excluded from the comparison; rectangles are clipped to the bitmap and their pixels count as ignored |
| IncludeMask | When True, the result carries a one-byte-per-pixel mask: 255 for changed pixels and 0 for unchanged or ignored pixels |
| IncludeOverlay | When True, the result carries an RGB bitmap of the second page with changed pixels tinted red |
Remarks
The comparison requires two bitmaps with equal dimensions, so the two pages must render at the same DPI, crop and scale settings.
Each bitmap is limited to 67,108,864 pixels and the tile grid to 4,194,304 tiles; a smaller TileSize on a large page can exceed the tile limit and fail the call.
See also
CompareRenderedPagesWith, CompareDocumentVisualsWith, TPDFVisualCompareResult