| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
Make sure U+FFFD is returned when a bounds check fails.
|
|
|
|
|
|
| |
For large palettes, looping over the entire chunk list is quite
slow. Store the list of active chunks in a separate sequence so we can
skip the unused ones.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
std/unicode has the following issues:
* Rune is an int32, which implies overflow checking. Also, it is
distinct, so you have to convert it manually to do arithmetic.
* QJS libunicode and Chagashi work with uint32, interfacing with these
required pointless type conversions.
* fastRuneAt is a template, meaning it's pasted into every call
site. Also, it decodes to UCS-4, so it generates two branches that
aren't even used. Overall this lead to quite some code bloat.
* fastRuneAt and lastRune have frustratingly different
interfaces. Writing code to handle both cases is error prone.
* On older Nim versions which we still support, std/unicode takes
strings, not openArray[char]'s.
Replace it with "twtuni", which includes some improved versions of
the few procedures from std/unicode that we actually use.
|
|
|
|
|
| |
Wait, why does std fastRuneAt try to decode UCS-32?
Hmm...
|
| |
|
|
|
|
| |
Now it mostly works, provided you set a compatible encoding.
|
| |
|
|
|
|
|
| |
WSL needs it. It was already allowed on Android, so this just makes the
sandboxes converge a little.
|
|
|
|
|
|
|
|
| |
Do it like parseEnumNoCase0, so we no longer instantiate a gazillion
different binary searches for the same type.
While we're at it, make matchNameProduction's searchInMap use uint32
too.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* round down to number divisible by 6 for height
* make pager's dispw match term's dispw even after width clamping
* make *BE procs actually emit/consume big-endian (lol)
* fix borked sixel set raster attributes & control string
I mixed up SRA with the device control string's parameters, so instead
of toggling transparency in the DCS, I was setting the second SRA
parameter to 0. Which, by the way, defines the aspect ratio's
denominator, and has nothing to do with transparency. Whoops.
|
|
|
|
| |
Makes it so we don't crash the entire browser upon encoding failure.
|
|
|
|
|
|
|
| |
Until recently, glibc used to implement it as fstatat. So don't trap
for fstatat (and for consistency, fstat), but return EPERM.
Just to be sure, rewrite sixel & stbi to never call fread.
|
|
|
|
| |
unused
|
|
|
|
| |
select allocates. (makes sense, but I never realized...)
|
|
|
|
|
|
|
| |
pain...
(also, fix an fd leak, plus a more general bug where we registered
empty output handles.)
|
| |
|
|
|
|
| |
+ be a bit more paranoid about double closes
|
| |
|
|
|
|
|
| |
* fix whitespace-surrounded asterisk turning into emphasis
* slightly refactor parseInline (it's still quite ugly...)
|
| |
|
| |
|
|
|
|
|
|
| |
See comment for details.
(Also, set the palette size based on quality for toBlob.)
|
| |
|
|
|
|
|
| |
Instead of storing pointers to cstrings, put all of them in a single
huge string and store indices of that.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* stream: and passFd is now client-based, and accessible for buffers
* Bitmap's width & height is now int, not uint64
* no more non-network Bitmap special case in the pager for canvas
I just shoehorned it into the static image model, so it still doesn't
render changes after page load. But at least now it doesn't crash the
browser.
|
| |
|
|
|
|
|
| |
it's really min-height, not height; consistency is not CSS's strong
suit...
|
|
|
|
| |
whoops
|
|
|
|
|
|
|
|
| |
* expand allowed color range somewhat
* update maximum sixel size on window resize
* fix kitty image cropping
* use faster algorithm for sixel compression (also produces less
wasteful output)
|
|
|
|
| |
+ update todo, readme
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
uses floyd-steinberg - I originally tried atkinson, but liked the
results with fs a bit more.
also, I got rid of the half hearted attempt to skip tree traversals for
color lookups, as it performs horribly with dithering. it *did* work if
I set Y as the key, but it still felt wrong - well, as it turns out,
octree traversal is faster anyway, so just do that.
it works out nicely because we can fill in holes (from dithering) with
a linear search for the nearest match as we go.
|
|
|
|
|
|
|
|
|
|
|
| |
ok, of course if you search for the nearest entry after setting blue
as the lowest index bits the search will be biased towards blue...
let's just skip the trouble of reconstructing closest color relations
by storing hashes in the octree - this way, I can ensure that the final
merged colors are present in the buckets that getColor then looks at
(while we're at it, also fix the color run merging code in quantize.)
|
| |
|
|
|
|
|
|
| |
* don't emit transparency request when we don't need it
* add lookup table for missing hash entries
* write(2)'ize
|
|
|
|
| |
& clean up outputSixelImage in general
|
| |
|
|
|
|
|
|
|
| |
in fact, we consider these to be the same image, and arguably that's
a bug in and of itself. but at least we don't crash anymore.
(also, update todo)
|
|
|
|
|
|
|
|
| |
just use an octree. works fine afaict, though obviously somewhat slower
than the static method (encoding is 2-pass now) & still has banding
issues with many colors (will need dithering)
also, fixed a bug that caused initial masks of bands to get misplaced
|
| |
|
|
|
|
|
|
|
|
| |
glibc likes to do weird things (such as calling stat) when you use
fread(3) and friends, so try to use functions that are more likely to
just do a single syscall.
Also, copy over some more paranoid read/write procedures to http.
|
|
|
|
| |
Somewhat rough, but better than nothing.
|
|
|
|
|
|
|
|
|
|
| |
* fix return type
* don't choke on empty bitmaps
* don't check for Cha-Image-Dimensions in encoder output (it was unused
anyways)
Mainly so that I can spec the encoder without Cha-Image-Dimensions as an
output header - it's pointless redundancy.
|
| |
|
|
|
|
|
|
|
|
| |
This caches sixel output. Works best when the line height is a multiple
of 6px, but should still be faster than the previous solution everywhere
else too (simply by virtue of encoding separate images in parallel).
Next step: actual color quantization
|
|
|
|
|
| |
avoid adding whitespace to the previous atom if it's not on the current
line
|
| |
|
| |
|
| |
|
| |
|