Pretty fascinating, I found the tip of the iceberg on XTerm's src [0] but it's kinda table driven so hard to tell what's going on :-). I just wanted to see exactly how much code was there in XTerm to support hardware that was popular between the 70s and early 80s.. [1]
Ages and ages ago I wrote a 'ppmtotek' program that would display raster graphics on terminal emulators with Tek 4014 graphics. It worked somewhat but depended on quirks of the specific terminal emulator. I should dust it off anyway.
https://jirkasnotes.wordpress.com/2019/07/17/xterm-does-grap...
Edit: a better demo: https://lock.cmpxchg8b.com/tektronix.html