aboutsummaryrefslogtreecommitdiff
path: root/sixel.h (follow)
Commit message (Collapse)AuthorAgeLines
* sixel: implement reflowDaniel Eklöf2020-10-11-0/+2
| | | | | | | Move sixel reflow from grid_reflow() to sixel_reflow(). This lets us use internal sixel functions to update the sixels. Note that grid_reflow() still needs to remap the sixelss coordinates.
* sixel: add sixel_cell_size_changed()Daniel Eklöf2020-10-11-0/+1
| | | | | This function should be called *after* the cell dimensions have changed, but *before* resizing/reflowing the grids.
* Merge branch 'master' into sixel-performanceDaniel Eklöf2020-06-29-0/+1
|\
| * sixel: destroy all sixels when font size is decreasedDaniel Eklöf2020-06-29-0/+1
| | | | | | | | | | | | If changing the font size causes the cell size to decrease, either horizontally or vertically (or both), then delete all sixels since the grid space they allocated no longer is enough to hold the images.
* | scroll: destroy scrolled out sixels before scroll is appliedDaniel Eklöf2020-06-29-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | The logic that breaks out of sixel loops does not work for rows that has already wrapped around. Thus, we need to destroy sixels that are about to be scrolled out *before* we actually scroll. Since this is the *only* time we destroy sixels (instead of overwriting it), rename the sixel functions. And, since they now do a very specific thing, they can be greatly simplified (and thus faster).
* | sixel: overwrite: pass 'width' to sixel_overwrite_at_cursor()Daniel Eklöf2020-06-28-1/+1
|/ | | | This is necessary to handle multi-column characters correctly.
* sixel: improve descriptions of sixel_delete_* and sixel_overwrite_*Daniel Eklöf2020-06-27-4/+14
|
* sixel: split -> overwriteDaniel Eklöf2020-06-27-4/+7
|
* term: erasing characters now splits sixels instead of deleting themDaniel Eklöf2020-06-27-0/+4
|
* sixel: refactor handling of wrap-around delete- and split regionsDaniel Eklöf2020-06-27-2/+3
| | | | | | | | | Handle these on a higher abstraction level. The low level functions that detect sixel intersections now assume the specified rectangle (or line region) does *not* cross the wrap-around. This is ensured by detecting a wrap-around region before hand, and splitting it up into two, non wrapping regions.
* sixel: add sixel_split_by_rectangle()Daniel Eklöf2020-06-27-1/+0
| | | | | | | | | This function splits a sixel image into up to four pieces. The four pieces correspond to the relative complement (set difference) of the sixel image and the specified rectangle. Use this function when (possibly) overwriting existing sixel images when generating a new one, i.e. in sixel_unhook().
* sixel: wip: split up image being overwritten, rather than erasing itDaniel Eklöf2020-06-23-0/+1
| | | | | | | | | | Instead of completely erasing a sixel image when it is being "overwritten" (text is printed somewhere within the image, or another sixel image is emitted within the first image), split it up into up to four pieces: 'above', 'below', 'to-the-left' and 'to-the-right'. This is currently very un-optimized, but seems to produce correct results.
* sixel: do not reset palette after each imageDaniel Eklöf2020-06-10-0/+2
| | | | | | | | A client can re-use the palette between images. Resetting the palette breaks this. Now we initialize the palette on demand, and resets it when the palette size is changed (by the client).
* sixel: add sixel_delete_at_row and sixel_delete_in_rangeDaniel Eklöf2020-02-24-0/+3
| | | | | These are utility functions to erase sixel images that are at the specified row, or in a row range.
* sixel: rename: purge_at_cursor() -> delete_at_cursor()Daniel Eklöf2020-02-22-1/+1
|
* sixel: purge images at current cursor rowDaniel Eklöf2020-02-22-0/+1
| | | | | When printing a character, or starting a new sixel image, purge all images that cover the cursor's current row.
* sixel: application configurable image max width/heightDaniel Eklöf2020-02-22-0/+5
|
* sixel: application configurable palette size (color count)Daniel Eklöf2020-02-22-0/+7
| | | | | This implements the CSI escapes for retrieving and (re)setting the palette size.
* sixel: add sixel_destroy()Daniel Eklöf2020-02-21-0/+2
|
* sixel: initial supportDaniel Eklöf2020-02-21-0/+7
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