<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/sixel.c, branch 1.17.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.17.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.17.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2024-03-25T15:33:15Z</updated>
<entry>
<title>sixel: abuse wmemset() when initializing a freshly allocated image buffer</title>
<updated>2024-03-25T15:33:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-25T15:33:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a99434929ced7673087458d18c4f78ae8a4c962a'/>
<id>urn:sha1:a99434929ced7673087458d18c4f78ae8a4c962a</id>
<content type='text'>
wmemset() is heavily optimized, and in some cases, *much* faster than
manually initializing the new image pixels.

Furthermore, assume calloc() is better at initializing memory to zero,
and use that when initializing new pixels in a transparent image.
</content>
</entry>
<entry>
<title>sixel: fix cursor positioning when image is split up into several</title>
<updated>2024-03-18T16:12:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-15T16:39:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9fcf5977c05686d55892d32fa3f980b03ef1b30a'/>
<id>urn:sha1:9fcf5977c05686d55892d32fa3f980b03ef1b30a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: hopefully handle image height correctly when trimming</title>
<updated>2024-03-18T16:11:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-15T16:23:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bce1d7313dfe04f92b7a37c0352637045b4881dc'/>
<id>urn:sha1:bce1d7313dfe04f92b7a37c0352637045b4881dc</id>
<content type='text'>
When trimming trailing empty rows from the final image, handle the RA
region correctly:

* If image is transparent, trim down to the last non-empty pixel row,
  regardless of whether it is inside or outside the RA region.

* If image is opaque, trim down to either the last non-empty pixel
  row, or the RA region, whatever is the largest height.
</content>
</entry>
<entry>
<title>sixel: RA region does not affect the text cursor position</title>
<updated>2024-03-18T16:11:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-15T14:11:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cb820a498bc8b9c3823f54d0452c2e5d30de1996'/>
<id>urn:sha1:cb820a498bc8b9c3823f54d0452c2e5d30de1996</id>
<content type='text'>
The raster attributes is, really, just a way to erase an area. And, if
the sixel is transparent, it's a nop.

The final text cursor position depends, not on our image size (which
is based on RA), but on the final graphical cursor position.

However, we do want to continue using it as a hint of the final image
size, to be able to pre-allocate the backing buffer.

So, here's what we do:

* When trimming trailing transparent rows, only trim the *image*, if
  the graphical cursor is positioned on the last sixel row, *and* the
  sixel is transparent.
* Opaque sixels aren't trimmed at all, since RA in this acts as an
  erase that fills the RA region with the background color.
* The graphical cursor position is always adjusted (i.e. trimmed),
  since it affects the text cursor position.
* The text cursor position is now calculated from the graphical cursor
  position, instead of the image height.
</content>
</entry>
<entry>
<title>sixel: trim trailing, fully transparent sixel rows</title>
<updated>2024-03-18T16:09:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-11T15:25:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cc660bc7c1a55e71f8c7a131fbcf8753b447f977'/>
<id>urn:sha1:cc660bc7c1a55e71f8c7a131fbcf8753b447f977</id>
<content type='text'>
See https://github.com/hpjansson/chafa/issues/192
</content>
</entry>
<entry>
<title>sixel: place cursor on the last character row touched by the sixel</title>
<updated>2024-03-18T15:58:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-04T15:18:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=282c55aa4ac9a082392ee13107958fd0b84e7767'/>
<id>urn:sha1:282c55aa4ac9a082392ee13107958fd0b84e7767</id>
<content type='text'>
After emitting a sixel, place the cursor on the character row touched
by the last sixel. The last sixel _may_ not be a multiple of 6
pixels, *if* the sixel had an explicit width/height set via raster
attributes.

This is an intended deviation from the DEC cursor placement algorithm,
where the cursor is placed on the character row touched by the last
sixel's *upper* pixel.

The adjusted algorithm implemented here makes it much easier for
applications to handle text-after-sixels, since they can now simply
assume a single text newline is required to move the cursor to a
character row not touched by the sixel.
</content>
</entry>
<entry>
<title>sixel: disable debug logging</title>
<updated>2024-03-16T07:57:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-16T07:57:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f17b989650a00d5b888c9634bded4407198b7c69'/>
<id>urn:sha1:f17b989650a00d5b888c9634bded4407198b7c69</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: initialize the color table to colors used by the VT340</title>
<updated>2024-03-15T14:19:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-15T14:19:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=60fd4a262c5a3ce1c3951e305bcade3a88019f8a'/>
<id>urn:sha1:60fd4a262c5a3ce1c3951e305bcade3a88019f8a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: don't try to emit a sixel if we're outside the image's boundaries</title>
<updated>2024-03-07T15:21:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-07T15:21:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3e6f0e63f3027f19a83c6a2ddcf52018d30f2751'/>
<id>urn:sha1:3e6f0e63f3027f19a83c6a2ddcf52018d30f2751</id>
<content type='text'>
Closes #1634
</content>
</entry>
<entry>
<title>sixel: debug: sixel image _may_ be zero-sized</title>
<updated>2024-03-07T15:20:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-07T15:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=75fd59df3f27f914729abd69d790e3a2a51c70e4'/>
<id>urn:sha1:75fd59df3f27f914729abd69d790e3a2a51c70e4</id>
<content type='text'>
For example, and single GNL (Graphical New Line) will result in a
sixel with a non-zero height, but a zero width.
</content>
</entry>
<entry>
<title>sixel: we no longer need the extra newline</title>
<updated>2024-03-07T15:19:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-07T15:19:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a2fa667f45015f616171eccac9d6f55789b281d2'/>
<id>urn:sha1:a2fa667f45015f616171eccac9d6f55789b281d2</id>
<content type='text'>
Since we never place the cursor *under* the sixel anymore.
</content>
</entry>
<entry>
<title>sixel: debug: fix logged width/height values when emitting sixel</title>
<updated>2024-03-07T15:18:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-07T15:18:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1421ba504d58764b7801be72912a9afdddd18cb6'/>
<id>urn:sha1:1421ba504d58764b7801be72912a9afdddd18cb6</id>
<content type='text'>
image.width and image.height are the scaled dimensions, and these
haven't been set when the log message is printed.
</content>
</entry>
<entry>
<title>sixel: performance improvements</title>
<updated>2024-03-06T15:37:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-04T15:40:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1568518ab3c30ce9d83d6e2c4a9d8e74bbe15051'/>
<id>urn:sha1:1568518ab3c30ce9d83d6e2c4a9d8e74bbe15051</id>
<content type='text'>
* Store pointer to current pixel (i.e. pixel we're about to write to),
  instead of a row-byte-offset. This way, we don't have to calculate the
  offset into the backing image every time we emit a sixel band.

* Pass data pointer directly to sixel_add_*(), to avoid having to
  calculate an offset into the backing image.

* Special case adding a single 1:1 sixel. This removes a for loop, and
  simplifies state (position) updates. It is likely LTO does this for
  us, but this way, we get it optimized in non-LTO builds as well.
</content>
</entry>
<entry>
<title>sixel: fix row height calculation in resize_vertically()</title>
<updated>2024-03-06T15:36:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-04T15:29:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8ff8ec5b70da567f28b6e0aba1d09931bd680fb3'/>
<id>urn:sha1:8ff8ec5b70da567f28b6e0aba1d09931bd680fb3</id>
<content type='text'>
In resize_vertically(), we assumed a sixel is 6 pixels tall. This is
mostly true, but not for non-1:1 sixels. Or, to be more precise, not
for sixels where 'pan' != 1.

This caused us to allocate too little backing memory, resulting in a
crash when we later tried to write to the image.
</content>
</entry>
<entry>
<title>Don't use fancy Unicode quotes, stick to ASCII</title>
<updated>2024-02-06T11:36:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-06T11:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7999975016a57cc0a2c2e20bc55f29de32df7044'/>
<id>urn:sha1:7999975016a57cc0a2c2e20bc55f29de32df7044</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: erase: fix clearing of cell-&gt;attrs.clean</title>
<updated>2023-10-12T14:31:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-12T14:22:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4aa67e464a04bf64d30aff70019ce0d8b4d5e136'/>
<id>urn:sha1:4aa67e464a04bf64d30aff70019ce0d8b4d5e136</id>
<content type='text'>
When erasing a sixel, the cells underneath it must be marked as
'dirty', in order to be re-rendered.

This was not being done correctly; the for loop loops *from* the start
col, meaning the *end* col is *not* sixel-&gt;pos.col, as that's
the *number* of columns, not the *end* column.
</content>
</entry>
<entry>
<title>sixel: fix regression for DECGRI with a repeat count of 0</title>
<updated>2023-07-10T16:51:32Z</updated>
<author>
<name>CismonX</name>
<email>admin@cismon.net</email>
</author>
<published>2023-07-10T16:51:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dbee099eebc46bd6a72f4be1b65c5552f02d471a'/>
<id>urn:sha1:dbee099eebc46bd6a72f4be1b65c5552f02d471a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: re-scale images when the cell dimensions change</title>
<updated>2023-06-30T06:29:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-29T12:49:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=49fb0cf359bb2486bbdf58df62c66c890d7e31cd'/>
<id>urn:sha1:49fb0cf359bb2486bbdf58df62c66c890d7e31cd</id>
<content type='text'>
Before this patch, when the cell dimensions changed (i.e. when the
font size changes), sixel images were either removed (the new cell
dimensions are smaller than the old), or simply kept at their original
size (new cell dimensions are larger).

With this patch, sixels are instead resized. This means a
sixel *always* occupies the same number of rows and columns,
regardless of how much the font size is changed.

This is done by maintaining two sets of image data and pixman images,
as well as their dimensions. These two sets are the new ‘original’ and
‘scaled’ members of the sixel struct.

The "top-level" pixman image pointer, and the ‘width’ and ‘height’
members either point to the "original", or the "scaled" version.

They are invalidated as soon as the cell dimensions change. They, and
the ‘scaled’ image is updated on-demand (when we need to render a
sixel).

Note that the ‘scaled’ image is always NULL when the current cell
dimensions matches the ones used when emitting the sixel (to save
run-time memory).

Closes #1383
</content>
</entry>
<entry>
<title>sixel: add_ar_11(): manually unroll loop</title>
<updated>2023-06-29T13:40:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T14:21:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5e9d68695c05d4be03ac7b83dd0eabc42bb7fefd'/>
<id>urn:sha1:5e9d68695c05d4be03ac7b83dd0eabc42bb7fefd</id>
<content type='text'>
This generates both smaller, and faster code
</content>
</entry>
<entry>
<title>sixel: refactor: shorten very verbose switch case statements</title>
<updated>2023-06-29T13:40:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T13:39:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=75f9bed6b6fc7bc97927d70e9e7df75dcea621c4'/>
<id>urn:sha1:75f9bed6b6fc7bc97927d70e9e7df75dcea621c4</id>
<content type='text'>
</content>
</entry>
</feed>
