mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
kill off sprixel_kitty_p(), hurrah
This commit is contained in:
parent
9c03fdcfb5
commit
37d64d96ec
@ -460,8 +460,8 @@ typedef struct tinfo {
|
|||||||
// wipe out a cell's worth of pixels from within a sprixel. for sixel, this
|
// wipe out a cell's worth of pixels from within a sprixel. for sixel, this
|
||||||
// means leaving out the pixels (and likely resizes the string). for kitty,
|
// means leaving out the pixels (and likely resizes the string). for kitty,
|
||||||
// this means dialing down their alpha to 0 (in equivalent space).
|
// this means dialing down their alpha to 0 (in equivalent space).
|
||||||
int (*pixel_cell_wipe)(const struct notcurses* nc, sprixel* s, int y, int x);
|
int (*pixel_wipe)(sprixel* s, int y, int x);
|
||||||
// perform the inverse of pixel_cell_wipe, restoring an annihilated sprixcell.
|
// 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, const uint8_t* auxvec);
|
||||||
int (*pixel_remove)(int id, FILE* out); // kitty only, issue actual delete command
|
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_init)(int fd); // called when support is detected
|
||||||
@ -934,11 +934,11 @@ plane_debug(const ncplane* n, bool details){
|
|||||||
|
|
||||||
// cell coordinates *within the sprixel*, not absolute
|
// cell coordinates *within the sprixel*, not absolute
|
||||||
int sprite_wipe(const notcurses* nc, sprixel* s, int y, int x);
|
int sprite_wipe(const notcurses* nc, sprixel* s, int y, int x);
|
||||||
int sixel_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell);
|
int sixel_wipe(sprixel* s, int ycell, int xcell);
|
||||||
// nulls out a cell from a kitty bitmap via changing the alpha value
|
// nulls out a cell from a kitty bitmap via changing the alpha value
|
||||||
// throughout to 0. the same trick doesn't work on sixel, but there we
|
// throughout to 0. the same trick doesn't work on sixel, but there we
|
||||||
// can just print directly over the bitmap.
|
// can just print directly over the bitmap.
|
||||||
int kitty_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell);
|
int kitty_wipe(sprixel* s, int ycell, int xcell);
|
||||||
int sixel_rebuild(sprixel* s, int ycell, int xcell, const uint8_t* auxvec);
|
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 kitty_rebuild(sprixel* s, int ycell, int xcell, const uint8_t* auxvec);
|
||||||
|
|
||||||
@ -1061,12 +1061,6 @@ sprixel_state(const sprixel* s, int y, int x){
|
|||||||
return s->n->tam[localy * s->dimx + localx].state;
|
return s->n->tam[localy * s->dimx + localx].state;
|
||||||
}
|
}
|
||||||
|
|
||||||
// is sprixel backend kitty (only valid after calling setup_kitty_bitmaps())?
|
|
||||||
// FIXME kill this off, and use different states instead
|
|
||||||
static inline bool sprixel_kitty_p(const tinfo* t){
|
|
||||||
return t->pixel_shutdown == kitty_shutdown;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
pool_release(egcpool* pool, nccell* c){
|
pool_release(egcpool* pool, nccell* c){
|
||||||
if(cell_extended_p(c)){
|
if(cell_extended_p(c)){
|
||||||
|
@ -335,7 +335,7 @@ int kitty_rebuild(sprixel* s, int ycell, int xcell, const uint8_t* auxvec){
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int kitty_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell){
|
int kitty_wipe(sprixel* s, int ycell, int xcell){
|
||||||
if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED){
|
if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED){
|
||||||
//fprintf(stderr, "CACHED WIPE %d %d/%d\n", s->id, ycell, xcell);
|
//fprintf(stderr, "CACHED WIPE %d %d/%d\n", s->id, ycell, xcell);
|
||||||
return 0; // already annihilated, needn't draw glyph in kitty
|
return 0; // already annihilated, needn't draw glyph in kitty
|
||||||
@ -343,8 +343,8 @@ int kitty_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell){
|
|||||||
uint8_t* auxvec = sprixel_auxiliary_vector(s);
|
uint8_t* auxvec = sprixel_auxiliary_vector(s);
|
||||||
//fprintf(stderr, "NEW WIPE %d %d/%d\n", s->id, ycell, xcell);
|
//fprintf(stderr, "NEW WIPE %d %d/%d\n", s->id, ycell, xcell);
|
||||||
const int totalpixels = s->pixy * s->pixx;
|
const int totalpixels = s->pixy * s->pixx;
|
||||||
const int xpixels = nc->tcache.cellpixx;
|
const int xpixels = s->cellpxx;
|
||||||
const int ypixels = nc->tcache.cellpixy;
|
const int ypixels = s->cellpxy;
|
||||||
// if the cell is on the right or bottom borders, it might only be partially
|
// if the cell is on the right or bottom borders, it might only be partially
|
||||||
// filled by actual graphic data, and we need to cap our target area.
|
// filled by actual graphic data, and we need to cap our target area.
|
||||||
int targx = xpixels;
|
int targx = xpixels;
|
||||||
|
@ -758,8 +758,7 @@ int sixel_rebuild(sprixel* s, int ycell, int xcell, const uint8_t* auxvec){
|
|||||||
// we return -1 because we're not doing a proper wipe -- that's not possible
|
// we return -1 because we're not doing a proper wipe -- that's not possible
|
||||||
// using sixel. we just mark it as partially transparent, so that if it's
|
// using sixel. we just mark it as partially transparent, so that if it's
|
||||||
// redrawn, it's redrawn using P2=1.
|
// redrawn, it's redrawn using P2=1.
|
||||||
int sixel_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell){
|
int sixel_wipe(sprixel* s, int ycell, int xcell){
|
||||||
(void)nc;
|
|
||||||
if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED){
|
if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED){
|
||||||
//fprintf(stderr, "CACHED WIPE %d %d/%d\n", s->id, ycell, xcell);
|
//fprintf(stderr, "CACHED WIPE %d %d/%d\n", s->id, ycell, xcell);
|
||||||
return 1; // already annihilated FIXME but 0 breaks things
|
return 1; // already annihilated FIXME but 0 breaks things
|
||||||
|
@ -48,7 +48,7 @@ void sprixel_free(sprixel* s){
|
|||||||
sprixel* sprixel_recycle(ncplane* n){
|
sprixel* sprixel_recycle(ncplane* n){
|
||||||
assert(n->sprite);
|
assert(n->sprite);
|
||||||
const notcurses* nc = ncplane_notcurses_const(n);
|
const notcurses* nc = ncplane_notcurses_const(n);
|
||||||
if(sprixel_kitty_p(&nc->tcache)){
|
if(nc->tcache.pixel_shutdown == kitty_shutdown){
|
||||||
sprixel* hides = n->sprite;
|
sprixel* hides = n->sprite;
|
||||||
int dimy = hides->dimy;
|
int dimy = hides->dimy;
|
||||||
int dimx = hides->dimx;
|
int dimx = hides->dimx;
|
||||||
@ -185,7 +185,7 @@ int sprite_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//fprintf(stderr, "ANNIHILATING %p %d\n", s->n->tam, s->dimx * ycell + xcell);
|
//fprintf(stderr, "ANNIHILATING %p %d\n", s->n->tam, s->dimx * ycell + xcell);
|
||||||
int r = nc->tcache.pixel_cell_wipe(nc, s, ycell, xcell);
|
int r = nc->tcache.pixel_wipe(s, ycell, xcell);
|
||||||
//fprintf(stderr, "WIPED %d %d/%d ret=%d\n", s->id, ycell, xcell, r);
|
//fprintf(stderr, "WIPED %d %d/%d ret=%d\n", s->id, ycell, xcell, r);
|
||||||
// mark the cell as annihilated whether we actually scrubbed it or not,
|
// mark the cell as annihilated whether we actually scrubbed it or not,
|
||||||
// so that we use this fact should we move to another frame
|
// so that we use this fact should we move to another frame
|
||||||
|
@ -13,7 +13,7 @@ setup_sixel_bitmaps(tinfo* ti){
|
|||||||
ti->sixel_maxy = 4096;
|
ti->sixel_maxy = 4096;
|
||||||
ti->pixel_remove = NULL;
|
ti->pixel_remove = NULL;
|
||||||
ti->pixel_destroy = sixel_destroy;
|
ti->pixel_destroy = sixel_destroy;
|
||||||
ti->pixel_cell_wipe = sixel_wipe;
|
ti->pixel_wipe = sixel_wipe;
|
||||||
ti->pixel_shutdown = sixel_shutdown;
|
ti->pixel_shutdown = sixel_shutdown;
|
||||||
ti->pixel_rebuild = sixel_rebuild;
|
ti->pixel_rebuild = sixel_rebuild;
|
||||||
ti->sprixel_height_factor = 6;
|
ti->sprixel_height_factor = 6;
|
||||||
@ -21,7 +21,7 @@ setup_sixel_bitmaps(tinfo* ti){
|
|||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
setup_kitty_bitmaps(tinfo* ti){
|
setup_kitty_bitmaps(tinfo* ti){
|
||||||
ti->pixel_cell_wipe = kitty_wipe;
|
ti->pixel_wipe = kitty_wipe;
|
||||||
ti->pixel_destroy = kitty_destroy;
|
ti->pixel_destroy = kitty_destroy;
|
||||||
ti->pixel_init = kitty_init;
|
ti->pixel_init = kitty_init;
|
||||||
ti->pixel_remove = kitty_remove;
|
ti->pixel_remove = kitty_remove;
|
||||||
|
Loading…
Reference in New Issue
Block a user