Documentation
¶
Overview ¶
Command resprobe measures how the CoC HUD scales between two framebuffer geometries.
The bot's geometry layer maps reference-frame coordinates onto the live frame with `ScaleRef(x,y) = (x*physW/RefWidth, y*physH/RefHeight)` — a model that is only correct when the emulator's UI scale factor is the same on both axes. Deciding whether a candidate device resolution can be adopted therefore needs one number per axis, not a guess: this probe takes a patch from a known reference capture (default 860x732), then searches the second capture over a grid of (scaleX, scaleY) pairs for the patch position that maximizes TM_CCOEFF_NORMED.
A best pair near (1,1) means the HUD kept its pixel geometry (resolution change is layout-neutral). A pair like (1.49, 0.98) means the layout follows the framebuffer ratio and the existing reference frame still models it. Anything else — e.g. (1.3, 1.15) — is an anisotropic stretch the reference-frame model cannot express, and the authored reference coordinates for that resolution must be re-measured.
Usage:
go run ./cmd/resprobe -a before.png -b after.png -x 20 -y 690 -w 90 -h 30