| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
| |
This fixes an assertion in debug builds, due to the pre-splitted and
splitted sixels overlapping.
|
| |
|
|
|
|
|
| |
When copying the image data for the left and right parts of the
splitted images, use the sixel's height, not the cell height.
This fixes a crash when the sixel didn't cover the entire cell height.
|
| |
|
|
|
| |
Two sixel may in fact exist on the same row, assuming their columns
don't overlap.
|
| | |
|
| |
|
|
| |
Cap 'width' to maximum number of columns available.
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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).
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Since the images are sorted, we can break out of the loop as soon as
we detect an image that *ends before* the rectangle's top starts.
In order for the row comparisons to work, the row numbers must be
re-based against the current scrollback offset, or the
scrollback *end*, to be precise.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Since the images are sorted, we can break out of the loop as soon as
we detect an image that *ends before* the row we're looking for.
In order for the row comparisons to work, the row numbers must be
re-based against the current scrollback offset, or the
scrollback *end*, to be precise.
|
| | |
| |
| |
| | |
This is necessary to handle multi-column characters correctly.
|
| | | |
|
| | | |
|
| |/
|
|
| |
Replace all tll_push_*() calls with calls to this function.
|
| | |
|
| | |
|
| |
|
|
| |
Avoid unnecessary wrap checks if the sixel image list is empty.
|
| | |
|
| |
|
|
|
|
| |
Instead, split them up into two (or more...).
This makes the intersection detection logic *much* simpler.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This reduces the burden on sixel_split_by_rectangle(), which would
otherwise consider the newly added/splitted sixels. Since we already
know they aren't covered by the specified rectangle, we can skip that.
|
| |
|
|
|
|
|
|
|
| |
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().
|
| |
|
|
|
|
| |
If a sixel image crossed the scrollback wrap around, the logic that
detected whether a row, or a row range, intersected with the sixel was
incorrect.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We used to auto-resize images to always be a multiple of 6.
This is incorrect. The client may, for example, have specified a size
to align the image to a cell boundary, which may not be a multiple of
6.
Furthermore, in e.g. Jexer, which splits up an image into stripes,
that the next image would "overwrite" the previous one. Since the next
image was started on a cell row that the previous image had overflowed
into.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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).
|
| | |
|
| | |
|
| |
|
|
| |
be represented in type 'int'
|
| | |
|
| |
|
|
|
| |
This way, the 'normal' and 'alt' grids have their own cursor state,
and we don't need to switch between them.
|
| |
|
|
|
|
|
|
|
|
|
| |
Update the sixels' 'row' attribute when re-flowing a grid, to ensure
it is rendered at the correct place.
This should work in most cases, but will break when the cell size has
changed (e.g. font size increase/decrease, or a DPI change).
This patch also moves the sixel image list from the terminal struct
into the grid struct. The sixels are per-grid after all.
|
| |
|
|
| |
This may happen e.g. when resizing a grid
|
| | |
|
| |
|
|
|
| |
This ensures sixel images are removed, regardless of _how_ the screen
was erased.
|
| | |
|
| |
|
|
|
| |
These are utility functions to erase sixel images that are at the
specified row, or in a row range.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This fixes an issue where the cursor was seen blinking in animated
GIFs.
|
| |
|
|
|
| |
When printing a character, or starting a new sixel image, purge all
images that cover the cursor's current row.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This implements the CSI escapes for retrieving and (re)setting the
palette size.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Use proper state names, and implement the state machine using switch
statements.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In unhook, add the generated image to a list of finished sixel images,
along with positioning and size information.
When rendering, loop this list of images, and render the images (or
parts of) that are visible.
When scrolling, check if any part of the images cover the re-cycled
lines, and if so, remove the *entire* image from the list.
This means we have the following limitations:
* The renderer always renders the whole (visible area of) the
image(s). There are times when this isn't necessary - for example,
when the image is scrolled inside the visible area.
* It would be nice if we could crop the image when parts of it is
scrolled out.
|
|
|
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
|