From 34bcbb505bc405910b0709e9d11a0c0fb3b8dc4a Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 10 Apr 2021 11:08:19 -0400 Subject: [PATCH] [xray] put streaming plane back above scrolling #1518 --- src/demo/xray.c | 8 ++++---- src/lib/kitty.c | 1 - src/lib/sixel.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/demo/xray.c b/src/demo/xray.c index e300500c2..2986611e0 100644 --- a/src/demo/xray.c +++ b/src/demo/xray.c @@ -65,9 +65,7 @@ perframecb(struct ncvisual* ncv, struct ncvisual_options* vopts, // only need these two steps done once, but we can't do them in // main() due to the plane being created in ncvisual_stream() =[ ncplane_set_resizecb(vopts->n, ncplane_resize_maximize); - // until #1518 is done, the stream isn't transparent, and thus it - // can obstruct the slider if there are few enough rows. FIXME - ncplane_move_above(vnewplane, vopts->n); + ncplane_move_above(vopts->n, vnewplane); struct notcurses* nc = ncplane_notcurses(vopts->n); static int frameno = 0; @@ -106,7 +104,9 @@ int xray_demo(struct notcurses* nc){ .scaling = NCSCALE_SCALE_HIRES, .blitter = NCBLIT_PIXEL, .flags = NCVISUAL_OPTION_NODEGRADE // to test for NCBLIT_PIXEL - | NCVISUAL_OPTION_VERALIGNED | NCVISUAL_OPTION_HORALIGNED, + | NCVISUAL_OPTION_VERALIGNED | NCVISUAL_OPTION_HORALIGNED + | NCVISUAL_OPTION_ADDALPHA, + .transcolor = 0, }; float dm = 0; // returns 0 if the selected blitter isn't available diff --git a/src/lib/kitty.c b/src/lib/kitty.c index f9f31edaa..91e4375c9 100644 --- a/src/lib/kitty.c +++ b/src/lib/kitty.c @@ -60,7 +60,6 @@ base64_rgba3(const uint32_t* pixels, size_t pcount, char* b64, bool wipe[static unsigned g = ncpixel_g(pixel); unsigned b = ncpixel_b(pixel); unsigned a = wipe[0] ? 0 : rgba_trans_p(pixel, transcolor) ? 0 : 255; -//fprintf(stderr, "WIPE: %d %d %d\n", wipe[0], wipe[1], wipe[2]); b64[0] = b64subs[(r & 0xfc) >> 2]; b64[1] = b64subs[(r & 0x3 << 4) | ((g & 0xf0) >> 4)]; b64[2] = b64subs[((g & 0xf) << 2) | ((b & 0xc0) >> 6)]; diff --git a/src/lib/sixel.c b/src/lib/sixel.c index d8b8074fe..9ab6eadda 100644 --- a/src/lib/sixel.c +++ b/src/lib/sixel.c @@ -147,7 +147,7 @@ extract_color_table(const uint32_t* data, int linesize, int begy, int begx, int for(int sy = visy ; sy < (begy + leny) && sy < visy + 6 ; ++sy){ // offset within sprixel const uint32_t* rgb = (data + (linesize / 4 * sy) + visx); int txyidx = (sy / cdimy) * cols + (visx / cdimx); - if(rgba_trans_p(ncpixel_a(*rgb), transcolor)){ + if(rgba_trans_p(*rgb, transcolor)){ if(tacache[txyidx] == SPRIXCELL_NORMAL){ tacache[txyidx] = SPRIXCELL_CONTAINS_TRANS; }