Expand description
Comparing two drawings of the same scene, by the engine’s one rule.
Structs§
- Difference
- How two drawings of the same size differ.
Constants§
- CLUSTER
- The largest cluster of touching unexplained pixels.
- EDGE
- A PNG’s or JPEG’s pixels, straight RGBA.
How far apart two drawings of the same scene may be. Two rasterizers of one
display list differ only in how they anti-alias an edge: a pixel on an edge
takes some value between the colors either side of it, and each rasterizer
picks a slightly different one. So a pixel is unexplained when, in some
channel, its value lies more than
EDGEoutside the range of the other drawing’s pixels around it (itself and its eight neighbours), in either direction. A missing or moved part — a divider, an icon, a word — leaves pixels no neighbour in the other drawing explains. At mostSHAREof the pixels may be unexplained, and no 8-connected cluster of them may be larger thanCLUSTER. - SHARE
- The largest share of pixels that may be unexplained.
Functions§
- compare
- How two RGBA buffers
widthpixels wide differ;Nonewhen their sizes differ. - matches
- Whether two RGBA buffers
widthpixels wide are the same drawing within the tolerance; otherwise how they differ, orNonefor different sizes. - pixels
- A PNG’s or JPEG’s pixels as straight RGBA, with its width and height — for comparing drawings.