direct-mode coloring #77

pull/296/head
nick black 5 years ago committed by Nick Black
parent d8849bb4b1
commit 3d4e157af6

@ -2050,6 +2050,12 @@ API void palette256_free(palette256* p);
// Convert the plane's content to greyscale.
API void ncplane_greyscale(struct ncplane* n);
// Direct mode. This API can be used to colorize and stylize output generated
// outside of notcurses, without ever calling notcurses_render(). These should
// not be intermixed with standard notcurses rendering.
API int term_bg_rgb8(struct notcurses* nc, FILE* out, unsigned r, unsigned g, unsigned b);
API int term_fg_rgb8(struct notcurses* nc, FILE* out, unsigned r, unsigned g, unsigned b);
#undef API
#ifdef __cplusplus

@ -261,7 +261,7 @@ summary_table(const char* spec){
long unsigned totalframes = 0;
uint64_t totalrenderns = 0;
printf("\n");
printf(" runtime│frames│output(B)│rendering│ %%r│%7s│%7s║\n", "FPS", "TFPS");
printf(" runtime│frames│output(B)│rendering│ %%r│%7s│%7s║\n", "FPS", "TheoFPS");
printf("══╤═╤════════╪══════╪═════════╪═════════╪═══╪═══════╪═══════╣\n");
char timebuf[PREFIXSTRLEN + 1];
char totalbuf[BPREFIXSTRLEN + 1];

@ -553,8 +553,7 @@ term_esc_rgb(notcurses* nc __attribute__ ((unused)), FILE* out, bool foreground,
return 0;
}
static inline int
term_bg_rgb8(notcurses* nc, FILE* out, unsigned r, unsigned g, unsigned b){
inline int term_bg_rgb8(notcurses* nc, 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
@ -579,8 +578,7 @@ term_bg_rgb8(notcurses* nc, FILE* out, unsigned r, unsigned g, unsigned b){
return 0;
}
static inline int
term_fg_rgb8(notcurses* nc, FILE* out, unsigned r, unsigned g, unsigned b){
inline int term_fg_rgb8(notcurses* nc, 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