init banner: punch up RGB signifier

dankamongmen/sixel-speedup
nick black 3 years ago committed by Nick Black
parent 7b28c68cd5
commit 43b3724f07

@ -1206,6 +1206,9 @@ int sixel_blit(ncplane* nc, int placey, int placex, int linesize,
const void* data, int begy, int begx,
int leny, int lenx, unsigned cellpixx);
int term_fg_rgb8(bool RGBflag, const char* setaf, int colors, FILE* out,
unsigned r, unsigned g, unsigned b);
typedef struct ncvisual_implementation {
int (*visual_init)(int loglevel);
void (*visual_printbanner)(const struct notcurses* nc);

@ -825,18 +825,28 @@ init_banner(const notcurses* nc){
printf("\n notcurses %s by nick black et al", notcurses_version());
term_fg_palindex(nc, stdout, nc->tcache.colors <= 256 ? 12 % nc->tcache.colors : 0x2080e0);
if(nc->tcache.cellpixy && nc->tcache.cellpixx){
printf("\n %d rows (%dpx) %d cols (%dpx) (%sB) %zuB cells %d colors%s\n",
printf("\n %d rows (%dpx) %d cols (%dpx) (%sB) %zuB cells %d colors",
nc->stdplane->leny, nc->tcache.cellpixy,
nc->stdplane->lenx, nc->tcache.cellpixx,
bprefix(nc->stats.fbbytes, 1, prefixbuf, 0), sizeof(nccell),
nc->tcache.colors, nc->tcache.RGBflag ? "+RGB" : "");
nc->tcache.colors);
}else{
printf("\n %d rows %d cols (%sB) %zuB cells %d colors%s\n",
printf("\n %d rows %d cols (%sB) %zuB cells %d colors",
nc->stdplane->leny, nc->stdplane->lenx,
bprefix(nc->stats.fbbytes, 1, prefixbuf, 0), sizeof(nccell),
nc->tcache.colors, nc->tcache.RGBflag ? "+RGB" : "");
}
printf(" compiled with gcc-%s, %s-endian\n"
nc->tcache.colors);
}
if(nc->tcache.RGBflag){
putc('+', stdout);
term_fg_rgb8(true, nc->tcache.setaf, nc->tcache.colors, stdout, 0xc0, 0x80, 0x80);
putc('R', stdout);
term_fg_rgb8(true, nc->tcache.setaf, nc->tcache.colors, stdout, 0x80, 0xc0, 0x80);
putc('G', stdout);
term_fg_rgb8(true, nc->tcache.setaf, nc->tcache.colors, stdout, 0x80, 0x80, 0xc0);
putc('B', stdout);
term_fg_palindex(nc, stdout, nc->tcache.colors <= 256 ? 12 % nc->tcache.colors : 0x2080e0);
}
printf("\n compiled with gcc-%s, %s-endian\n"
" terminfo from %s\n",
__VERSION__,
#ifdef __BYTE_ORDER__

@ -774,9 +774,8 @@ term_bg_rgb8(bool RGBflag, const char* setab, int colors, FILE* out,
return 0;
}
static inline int
term_fg_rgb8(bool RGBflag, const char* setaf, int colors, FILE* out,
unsigned r, unsigned g, unsigned b){
int term_fg_rgb8(bool RGBflag, const char* setaf, int colors, FILE* out,
unsigned r, unsigned g, unsigned b){
// We typically want to use tputs() and tiperm() to acquire and write the
// escapes, as these take into account terminal-specific delays, padding,
// etc. For the case of DirectColor, there is no suitable terminfo entry, but

Loading…
Cancel
Save