aboutsummaryrefslogtreecommitdiff
path: root/dcs.c (follow)
Commit message (Collapse)AuthorAgeLines
* sixel: implement P2=1 - transparent pixelsDaniel Eklöf2021-03-11-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | When P2=1, empty pixels are transparent. This patch also changes the behavior of P2=0|2, from setting empty pixels to the default background color, to instead use the *current* background color. To implement this, a couple of changes are needed: * Sixel pixels always use alpha=1.0, except for *empty* cells when P2=1 (i.e. transparent pixels). * The renderer draws sixels with the OVER operator, instead of the SRC operator. * The renderer *must* now render the cells beneath the sixel. As an optimization, this is only done for sixels where P2=1. I.e. for fully opaque sixels, there’s no need to render the cells beneath. The sixel renderer isn’t yet hooked into the multi-threaded renderer. This means *rows* (not just the cells) beneath maybe-transparent sixels are rendered single-threaded. Closes #391.
* debug: rename assert() to xassert(), to avoid clashing with <assert.h>Craig Barnes2021-01-16-5/+5
|
* vt: don’t ignore extra private/intermediate charactersDaniel Eklöf2020-12-16-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Take ‘\E(#0’ for example - this is *not* the same as ‘\E(0’. Up until now, foot has however treated them as the same escape, because the handler for ‘\E(0’ didn’t verify there weren’t any _other_ private characters present. Fix this by turning the ‘private’ array into a single 4-byte integer. This allows us to match *all* privates with a single comparison. Private characters are added to the LSB first, and MSB last. This means we can check for single privates in pretty much the same way as before: switch (term->vt.private) { case ‘?’: ... break; } Checking for two (or more) is much uglier, but foot only supports a *single* escape with two privates, and no escapes with three or more: switch (term->vt.private) { case 0x243f: /* ‘?$’ */ ... break; } The ‘clear’ action remains simple (and fast), with a single write operation. Collecting privates is potentially _slightly_ more complex than before; we now need mask and compare, instead of simply comparing, when checking how many privates we already have. We _could_ add a counter, which would make collecting privates easier, but this would add an additional write to the ‘clean’ action which is really bad since it’s in the hot path.
* sixel: initial supportDaniel Eklöf2020-02-21-3/+20
| | | | | | | | | This implements basic parsing of sixel data. Lots of limitations and temporary solutions as this is still work-in-progress: * Maximum image size hardcoded to 800x800 * No HLS color format support * Image is always rendered at 0x0 in the terminal
* dcs: fix comment: ESU is *End* synchronized updateDaniel Eklöf2020-01-29-1/+1
|
* dcs: bsu/esu: convert warning log to debug logDaniel Eklöf2020-01-26-2/+2
|
* dcs: remove abort() from BSU/ESUDaniel Eklöf2020-01-25-2/+0
|
* dcs: remove assert; handler may be zero on unimplemented OCS commandDaniel Eklöf2020-01-20-1/+0
|
* term: shorten application_synchronized_updates -> app_sync_updatesDaniel Eklöf2020-01-12-2/+2
|
* dcs: bsu/esu: add link to specDaniel Eklöf2020-01-12-0/+4
|
* dcs: abort() in bsu/esuDaniel Eklöf2020-01-12-2/+4
| | | | | Since I haven't seen this in the wild, let's abort() to make sure we catch when an application does this, so we can verify it really works.
* term/render: move {enable,disable}_application_synchronized_updates()Daniel Eklöf2020-01-12-3/+2
| | | | From render -> terminal
* render: rename render_{enable,disable}_refresh()Daniel Eklöf2020-01-12-2/+3
|
* dcs: bsu/esu: call render_{disable,enable}_refresh()Daniel Eklöf2020-01-12-6/+8
|
* dcs: abort() in bsu/esuDaniel Eklöf2020-01-12-0/+2
| | | | I **really** want to know if someone is using these...
* dcs: put: don't append data if buffer resize failedDaniel Eklöf2020-01-12-1/+2
|
* dcs: use default param value of 0 in log messageDaniel Eklöf2020-01-12-1/+1
|
* dcs: initial handling of DCS in generalDaniel Eklöf2020-01-12-0/+87
| | | | | | | | | | | | | | | | | | | | | | Add data structure to term->vt. This structure tracks the free-form data that is passed-through, and the handler to call at the end. Intermediates and parameters are collected by the normal VT parser. Then, when we enter the passthrough state, we call dcs_hook(). This function checks the intermediate(s) and parameters, and selects the appropriate unhook handler (and optionally does some execution already). In passthrough mode, we simply append strings to an internal buffer. This might have to be changed in the future, if we need to support a DCS that needs to execute as we go. In unhook (i.e. when the DCS is terminated), we execute the unhook handler. As a proof-of-concept, handlers for BSU/ESU (Begin/End Synchronized Update) has been added (but are left unimplemented).
* dcs: we have no parent terminal to pass through toDaniel Eklöf2019-07-21-32/+0
|
* dcs: sort of implement DCS passthroughDaniel Eklöf2019-07-19-0/+32
We now store the passthrough characters in a buffer, and call dcs_passthrough() on unhook. However, dcs_passthrough() doesn't do anything.