<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/sixel.c, branch 1.6.3</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.6.3</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.6.3'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-01-21T10:57:46Z</updated>
<entry>
<title>Add xsnprintf() and remove some unnecessary strlen(3) calls</title>
<updated>2021-01-21T10:57:46Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-01-14T21:30:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d2c00d73ec087e2266d8e07daacb0732fc1ca761'/>
<id>urn:sha1:d2c00d73ec087e2266d8e07daacb0732fc1ca761</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: current geometry: don’t exceed current window dimensions</title>
<updated>2021-01-21T10:57:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-14T13:41:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=acb3f1cd10213b95d9fc1b8f1010e105d5ebab9f'/>
<id>urn:sha1:acb3f1cd10213b95d9fc1b8f1010e105d5ebab9f</id>
<content type='text'>
This is similar to what XTerm does, and fixes an issue with lsix,
where the output did not wrap.
</content>
</entry>
<entry>
<title>sixel: change default max size to 10000x10000</title>
<updated>2020-11-23T19:10:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-23T19:10:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ba8b15d67592c3dfde264ccd441699377948c4cf'/>
<id>urn:sha1:ba8b15d67592c3dfde264ccd441699377948c4cf</id>
<content type='text'>
It used to be the size of the window. This caused images to be cropped
when the application emitting them didn’t change the max size.
</content>
</entry>
<entry>
<title>sixel: fix crash when an explicit sixel size had a height less than 6 pixels</title>
<updated>2020-11-23T18:22:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-23T18:22:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=275f97381d585c09c446946d46fb13956fc4ed89'/>
<id>urn:sha1:275f97381d585c09c446946d46fb13956fc4ed89</id>
<content type='text'>
</content>
</entry>
<entry>
<title>hsl: add our own implementations of rgb-to-hsl and hsl-to-rgb</title>
<updated>2020-11-15T18:45:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-15T18:45:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e0297daa1fcf90a911fd236971e1a2b433f7b134'/>
<id>urn:sha1:e0297daa1fcf90a911fd236971e1a2b433f7b134</id>
<content type='text'>
* New function: rgb_to_hsl()
* New function: hsl_to_rgb()
* Replace XTerm’s hls_to_rgb() with our own, hsl_to_rgb().
* Ensure hue/lum/sat values are within range before calling
  hsl_to_rgb()

Note that sixels’ use the following primary hues:

*  blue:  0°
*  red:   120
*  green: 240°

While “standard” HSL uses:

*  red:   0°
*  green: 120°
*  blue:  240°

Thus, we need to adjust the sixel’s hue value before calling
hsl_to_rgb().
</content>
</entry>
<entry>
<title>render: improve sixel rendering performance</title>
<updated>2020-11-13T15:54:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-11-13T15:54:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4b645376fd84abae9bab91b475daa7d356488e0a'/>
<id>urn:sha1:4b645376fd84abae9bab91b475daa7d356488e0a</id>
<content type='text'>
Up until now, we’ve always re-rendered the entire image (the part of
it that is visible at least), *every* time we render a frame.

This is not really needed. In many cases, the cells covered by the
image hasn’t been touched.

Rewrite the sixel rendering code to only render the part of the sixel
image that covers dirty cells.

This is done on a per-row basis. I.e. Each *row* of the image that
covers at least one dirty cell is re-rendered. For this to work, we
now also dirty all cells covered by the image when we emit the image.

Finally, for this to work, the sixels need to be rendered *before* we
do the normal grid render pass (since that will clear all dirty bits).
</content>
</entry>
<entry>
<title>sixel: reflow: drop sixels that crosses the scrollback history’s end</title>
<updated>2020-10-09T05:44:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-05T16:33:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=468add5591699215bc2ce16a0db1957d838b8fe4'/>
<id>urn:sha1:468add5591699215bc2ce16a0db1957d838b8fe4</id>
<content type='text'>
This fixes various crashes that occurred after a reflow due to the
sixel image list invariants no longer being true.
</content>
</entry>
<entry>
<title>sixel: unhook: do overwrite *after* linefeeding</title>
<updated>2020-10-09T05:44:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-05T16:32:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2c952761f2b113bf2c3f45abfe8119f243f38f88'/>
<id>urn:sha1:2c952761f2b113bf2c3f45abfe8119f243f38f88</id>
<content type='text'>
This ensures the overwrite is done when the scrollback history is in
the same state as when we then insert the new image.
</content>
</entry>
<entry>
<title>sixel: overwrite: use pixman to calculate new the sixel boundaries</title>
<updated>2020-10-09T05:44:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-05T16:31:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=93f5e743cc70473eb9c528ea8ef89cbc3ed2d73e'/>
<id>urn:sha1:93f5e743cc70473eb9c528ea8ef89cbc3ed2d73e</id>
<content type='text'>
When punching a hole in a sixel (and thus splitting it up into up to
four new sixels), use pixman to calculate the new sixel coordinates
and sizes.
</content>
</entry>
<entry>
<title>sixel: ovewrite-by-rectangle: in debug builds, cross-reference against pixman</title>
<updated>2020-10-09T05:44:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-05T16:30:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=91c0aed26e387097dddadeee05b2af1773f972a1'/>
<id>urn:sha1:91c0aed26e387097dddadeee05b2af1773f972a1</id>
<content type='text'>
Use pixman to calculate the intersection of the rectangle being
overwritten, and the sixel(s). Verify our code matches.
</content>
</entry>
<entry>
<title>sixel: verify scrollback consistency: new verify function</title>
<updated>2020-10-09T05:44:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-05T16:29:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5ebab9dea94c1fd06293e71ea3b904bc9902ad1e'/>
<id>urn:sha1:5ebab9dea94c1fd06293e71ea3b904bc9902ad1e</id>
<content type='text'>
Verifies sixels have been scrolled out correctly
</content>
</entry>
<entry>
<title>sixel: add comments to verify_*() functions</title>
<updated>2020-10-09T05:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-05T16:28:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=11760e9071e831bd883d6f502aae4fbf38b4851f'/>
<id>urn:sha1:11760e9071e831bd883d6f502aae4fbf38b4851f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: verify-*: don’t return anything; rely on asserts only</title>
<updated>2020-10-09T05:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-04T17:29:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5607e5d6583220b680186edc4b574015a312c0b9'/>
<id>urn:sha1:5607e5d6583220b680186edc4b574015a312c0b9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: scroll up/down: early return when list is empty</title>
<updated>2020-10-09T05:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-04T17:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0a5a6cb7fa58577989716976a3430a9de4cac860'/>
<id>urn:sha1:0a5a6cb7fa58577989716976a3430a9de4cac860</id>
<content type='text'>
Branch tagged as ‘likely’ for performance reason
</content>
</entry>
<entry>
<title>sixel: cell-size-changed: don’t verify sixels here</title>
<updated>2020-10-09T05:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-04T17:22:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=984083bf19d15db5972bfda1e9d2e205f6015ddd'/>
<id>urn:sha1:984083bf19d15db5972bfda1e9d2e205f6015ddd</id>
<content type='text'>
The state after this function is an intermediate state and isn’t
necessarily valid.

This sixels needs to be ‘reflowed’ to ensure a valid state. This is
something that should be done by the caller after the text grid has
been reflowed and the sixel coordinates have been re-mapped to the new
grid.

TODO: can/should we update the sixel cols/rows in sixel_reflow()
instead?
</content>
</entry>
<entry>
<title>sixel: unhook: look total number of sixels</title>
<updated>2020-10-09T05:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-04T17:17:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cf620cf3d002c67a4d4bbf418a6c4230d1ab97c4'/>
<id>urn:sha1:cf620cf3d002c67a4d4bbf418a6c4230d1ab97c4</id>
<content type='text'>
This helps debug sixel overwrites, as it makes it more visible when
there are sixels that _should_ have been removed.
</content>
</entry>
<entry>
<title>sixel: scroll-up: don’t break out early of loop</title>
<updated>2020-10-09T05:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-04T17:11:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b66e235e84f37d1995334580e0b7074fcc9e16a0'/>
<id>urn:sha1:b66e235e84f37d1995334580e0b7074fcc9e16a0</id>
<content type='text'>
This function loops the list of sixels, and discards those that would
be scrolled out if the grid offset is moved forward by the specified
number of rows.

The criteria is when the rebased row value is less than the number of
rows to scroll.

A rebased row number is a zero-based number starting at the beginning
of the scrollback. Thus, when scrolling 5 rows, rows with a rebased
row number between 0-4 will be scrolled out.

For performance reasons, we used to break out of the loop as soon as a
row number *larger* than the scroll count.

This however does not work. The sixels are sorted by their *end*
row. While this works in most cases (think images outputted in the
shell in the normal screen), it doesn’t always.

In the alt screen, where applications can print images just about
anywhere, it is possible to have *any* start row number anywhere in
the sixel list. Just as long as their *end* row numbers are sorted.

For example, a huuuge sixel that covers the entire scrollback. This
sixel will naturally be first in the list (and thus sixel_scroll_up()
will visit it *last*, since it iterates the list in reverse), but
should still be destroyed when scrolling.
</content>
</entry>
<entry>
<title>sixel: verify-list-order: add an ‘index’ variable</title>
<updated>2020-10-09T05:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-04T17:10:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e870a0068f1967c98f5044890b5f9c0683f240dd'/>
<id>urn:sha1:e870a0068f1967c98f5044890b5f9c0683f240dd</id>
<content type='text'>
This will make it easier when debugging assertions in this function.
</content>
</entry>
<entry>
<title>sixel: overwrite-by-rectangle: assert sixels don’t cross scrollback wrap-around</title>
<updated>2020-10-09T05:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-04T12:05:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=675f3e56c82524cf45526d6856c906133f341c25'/>
<id>urn:sha1:675f3e56c82524cf45526d6856c906133f341c25</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: scroll: call sixel_erase() instead of sixel_destroy()</title>
<updated>2020-10-09T05:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-10-04T12:03:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8168fc19dff6616312496a194fb70dff5827e5f9'/>
<id>urn:sha1:8168fc19dff6616312496a194fb70dff5827e5f9</id>
<content type='text'>
This ensures the screen is updated correctly. Without this, the sixel
image would remain on screen until force-refreshed by some other means.
</content>
</entry>
</feed>
