smooth pixel motion #1682

pull/2274/head
nick black 3 years ago committed by nick black
parent 676b92187b
commit ccad129fc2

@ -533,7 +533,16 @@ int kitty_wipe(sprixel* s, int ycell, int xcell){
int kitty_commit(fbuf* f, sprixel* s, unsigned noscroll){
loginfo("Committing Kitty graphic id %u\n", s->id);
fbuf_printf(f, "\e_Ga=p,i=%u,p=1,q=2%s\e\\", s->id, noscroll ? ",C=1" : "");
int i;
if(s->pxoffx || s->pxoffy){
i = fbuf_printf(f, "\e_Ga=p,i=%u,p=1,X=%u,Y=%u%s\e\\", s->id,
s->pxoffx, s->pxoffy, noscroll ? ",C=1" : "");
}else{
i = fbuf_printf(f, "\e_Ga=p,i=%u,p=1,q=2%s\e\\", s->id, noscroll ? ",C=1" : "");
}
if(i < 0){
return -1;
}
s->invalidated = SPRIXEL_QUIESCENT;
return 0;
}
@ -1074,6 +1083,8 @@ kitty_blit_core(ncplane* n, int linesize, const void* data, int leny, int lenx,
n->tam, SPRIXEL_UNSEEN) < 0){
goto error;
}
s->pxoffx = pxoffx;
s->pxoffy = pxoffy;
return 1;
error:

@ -150,6 +150,7 @@ typedef struct sprixel {
int movedfromx; // so that we can damage old cells when redrawn
// only used for kitty-based sprixels
int parse_start; // where to start parsing for cell wipes
int pxoffy, pxoffx; // X and Y parameters to display command
// only used for sixel-based sprixels
unsigned char* needs_refresh; // one per cell, whether new frame needs damage
struct sixelmap* smap; // copy of palette indices + transparency bits

Loading…
Cancel
Save