Spriteful TErminal GrAphics Protocol: Difference between revisions
No edit summary |
|||
| Line 18: | Line 18: | ||
* require me to render text myself | * require me to render text myself | ||
==Assumptions== | |||
* An eight-bit, UTF-8 environment. | |||
* ESC (0x1b, 27) starts a new control sequence, terminating any ongoing one. This is necessary to conform to widespread existing behavior, but it is unfortunate, as it means we can't blithely write arbitrary bytes. | |||
* We mustn't tread on any defined [https://invisible-island.net/xterm/ctlseqs/ctlseqs.html XTerm control sequences]. | |||
==Bulk data format== | ==Bulk data format== | ||
| Line 24: | Line 29: | ||
If the terminal emulator cannot fully implement RGBA for some reason (perhaps it has only 256 colors at its disposal), it ought itself sensibly quantize the graphic. Likewise, in the absence of composed translucency, the Alpha channel can be partitioned into a wholly transparent range and a wholly opaque range. <b>It is mandatory that a pixel with an Alpha value of 0 not obscure an existing pixel</b>. | If the terminal emulator cannot fully implement RGBA for some reason (perhaps it has only 256 colors at its disposal), it ought itself sensibly quantize the graphic. Likewise, in the absence of composed translucency, the Alpha channel can be partitioned into a wholly transparent range and a wholly opaque range. <b>It is mandatory that a pixel with an Alpha value of 0 not obscure an existing pixel</b>. | ||
The graphic's geometry is always communicated first, as a mandatory part of the control sequence. | |||