keller demo: separate legend lines

pull/1383/head
nick black 3 years ago
parent 7e451c42d2
commit a9c257465a
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -30,9 +30,9 @@ visualize(struct notcurses* nc, struct ncvisual* ncv){
const char* name = notcurses_str_blitter(bs[i]);
int scalex, scaley, truey, truex;
ncvisual_geom(nc, ncv, &vopts, &truey, &truex, &scaley, &scalex);
ncplane_putstr_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2 - 3, NCALIGN_CENTER, name);
ncplane_printf_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2 - 1, NCALIGN_CENTER,
"%dx%d", truex, truey);
ncplane_putstr_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2, NCALIGN_CENTER, name);
"%03dx%03d", truex, truey);
ncplane_printf_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2 + 1, NCALIGN_CENTER,
"%d:%d pixels -> cell", scalex, scaley);
int ret = demo_render(nc);

@ -5,10 +5,12 @@ break_sixel_comps(unsigned char comps[static 3], uint32_t rgba, unsigned char ma
comps[0] = (ncpixel_r(rgba) & mask) * 100 / 255;
comps[1] = (ncpixel_g(rgba) & mask) * 100 / 255;
comps[2] = (ncpixel_b(rgba) & mask) * 100 / 255;
//fprintf(stderr, "%u %u %u\n", comps[0], comps[1], comps[2]);
}
// first pass: extract up to 256 sixelspace colors over arbitrarily many sixels
// sixelspace is 0..100 corresponding to 0..255, lame =[
// FIXME you can have more (or fewer) than 256 registers...detect?
typedef struct colortable {
int colors;
int sixelcount;

Loading…
Cancel
Save