|
|
|
@ -462,7 +462,7 @@ typedef struct tinfo {
|
|
|
|
|
// this means dialing down their alpha to 0 (in equivalent space).
|
|
|
|
|
int (*pixel_wipe)(sprixel* s, int y, int x);
|
|
|
|
|
// perform the inverse of pixel_wipe, restoring an annihilated sprixcell.
|
|
|
|
|
int (*pixel_rebuild)(sprixel* s, int y, int x, const uint8_t* auxvec);
|
|
|
|
|
int (*pixel_rebuild)(sprixel* s, int y, int x, uint8_t* auxvec);
|
|
|
|
|
int (*pixel_remove)(int id, FILE* out); // kitty only, issue actual delete command
|
|
|
|
|
int (*pixel_init)(int fd); // called when support is detected
|
|
|
|
|
int (*pixel_draw)(const struct notcurses* n, const struct ncpile* p, sprixel* s, FILE* out);
|
|
|
|
@ -939,8 +939,8 @@ int sixel_wipe(sprixel* s, int ycell, int xcell);
|
|
|
|
|
// throughout to 0. the same trick doesn't work on sixel, but there we
|
|
|
|
|
// can just print directly over the bitmap.
|
|
|
|
|
int kitty_wipe(sprixel* s, int ycell, int xcell);
|
|
|
|
|
int sixel_rebuild(sprixel* s, int ycell, int xcell, const uint8_t* auxvec);
|
|
|
|
|
int kitty_rebuild(sprixel* s, int ycell, int xcell, const uint8_t* auxvec);
|
|
|
|
|
int sixel_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec);
|
|
|
|
|
int kitty_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec);
|
|
|
|
|
|
|
|
|
|
void sprixel_free(sprixel* s);
|
|
|
|
|
void sprixel_hide(sprixel* s);
|
|
|
|
@ -991,17 +991,16 @@ sprite_draw(const notcurses* n, const ncpile* p, sprixel* s, FILE* out){
|
|
|
|
|
static inline int
|
|
|
|
|
sprite_rebuild(const notcurses* nc, sprixel* s, int ycell, int xcell){
|
|
|
|
|
int ret = 0;
|
|
|
|
|
uint8_t* auxvec = s->n->tam[s->dimx * ycell + xcell].auxvector;
|
|
|
|
|
// special case the transition back to SPRIXCELL_TRANSPARENT; this can be
|
|
|
|
|
// done in O(1), since the actual glyph needn't change.
|
|
|
|
|
if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED_TRANS){
|
|
|
|
|
s->n->tam[s->dimx * ycell + xcell].state = SPRIXCELL_TRANSPARENT;
|
|
|
|
|
}else if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED){
|
|
|
|
|
uint8_t* auxvec = s->n->tam[s->dimx * ycell + xcell].auxvector;
|
|
|
|
|
// sets the new state itself
|
|
|
|
|
ret = nc->tcache.pixel_rebuild(s, ycell, xcell, auxvec);
|
|
|
|
|
}
|
|
|
|
|
s->n->tam[s->dimx * ycell + xcell].auxvector = NULL;
|
|
|
|
|
free(auxvec);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|