[PATCH] apply DECERA/DECFRA to sixels

15 views
Skip to first unread message

nick black

unread,
Jun 26, 2021, 4:06:19 AM6/26/21
to dic...@invisible-island.net
Grandmaster Dickey,

I have found that DECERA/DECFRA do not apply to Sixel within the
specified rectangular region. The documentation I've read
doesn't seem explicit one way or the other:

https://vt100.net/docs/vt510-rm/DECERA.html
https://vt100.net/docs/vt510-rm/DECFRA.html

but perhaps you have documentation beyond this that locks things
down. Alternatively, perhaps the six-row nature of sixel isn't
immediately amenable to rectangular erasure, since it might end
mid-cell? But the possibility remains that this was merely an
oversight, in which case the attached patch ought at least be a
starting point for remedying the issue.

This probably ought apply to DECSERA, DECSEL, etc. If so, the
attached patch ought be easily enough generalized.

It seems to me intuitive and expected that these control sequences
would obliterate all (non-protected) content. Erase Display,
Erase Character, and Erase Line *do* (by test and visual
inspection) apply to Sixel, which seems correct (I've been
unable to get Erase Area working in any capacity, and assume
it's an aixterm-only deal).

This came up in the following Notcurses issue, if you're interested:

https://github.com/dankamongmen/notcurses/issues/1740

Please feel free to use this patch however you see fit, or to
reject it if inappropriate.

BTW, thanks for fixing up the TIOCGWINSZ-on-font-change issue in
Patch 368! I updated the historical reference at

https://nick-black.com/dankwiki/index.php?title=Theory_and_Practice_of_Sprixels#Other_people.27s_bugs

Hack on!

--nick

--
nick black -=- https://www.nick-black.com
to make an apple pie from scratch,
you need first invent a universe.
xterm-368-decerasixels.diff.txt

nick black

unread,
Jun 26, 2021, 4:06:21 AM6/26/21
to dic...@invisible-island.net
nick black left as an exercise for the reader:
> Grandmaster Dickey,
> I have found that DECERA/DECFRA do not apply to Sixel within the
> specified rectangular region. The documentation I've read
> doesn't seem explicit one way or the other:

Please withdraw this patch and suggestion, at least for DECFRA.
I just discovered that DECFRA replaces glyphs underneath a
partially-transparent Sixel without damaging the Sixel, which
ought allow me a tremendous speedup when I need perform such an
update.

Currently, if I have a glyph underneath a partially-transparent
Sixel, and I want to update it, I have to do so, and then redraw
at least the damaged part of the Sixel. Since "redrawing" such a
partially-transparent Sixel means first touching every glyph it
covers, I'm effectively drawing the entire affected region twice
to change any single glyph underneath it. With DECFRA working as
it currently does, I can just emit those as single-cell DECFRAs,
and avoid the entire redraw. That's great. That's a huge win.
Reply all
Reply to author
Forward
0 new messages