https://helpx.adobe.com/uk/camera-raw/using/leica-perspective-control.html
https://www.reddotforum.com/content/2021/01/leica-perspective-control-for-m10-r-m10-p-and-m10m/
Leica cameras, and perhaps others, embed metadata relating to the tilt of the shot in the raw files that they produce. This allows much more precise perspective correction control in the resulting image.
It should not be hard to implement the interpretation of this metadata, where it is present. Works nicely in Lightroom / Camera RAW, with the Transform function.