notcurses
notcurses copied to clipboard
encode sprixels at raster time
It looks more and more likely that we'll need carry around a copy of our backing image past ncvisual_blit()
time. If so, we ought look at postponing encoding to rasterization time. That way, we don't bother encoding a bunch of material which ends up getting wiped on first display anyway. Indeed, maybe we never keep the encoded version around, only generating it directly into the fbuf
at rasterization time. That ought be a wash with regards to carrying around the original data. Yeah, I like this.
So what would be involved? An ncvisual
can be destroyed following the ncvisual_blit()
, since the (encoded) data is now part of the plane (via its attached sprixel
object). So we would just keep a copy of the raw RGBA data in the sprixel
, and encode only at draw time. The downside of not keeping our own copy of the encode would of course be that further wipes etc. would require a full reencoding. On the plus side, we only reencode once per raster max, whereas there might be any number of wipes within that time.
Think about it.