cell_no{fore/back}ground() was never intended for export

This commit is contained in:
nick black 2020-07-25 21:53:50 -04:00
parent c333c4def5
commit 17e8f62eb9
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
5 changed files with 20 additions and 31 deletions

View File

@ -231,11 +231,6 @@ namespace ncpp
return cell_bg_default_p (&_cell); return cell_bg_default_p (&_cell);
} }
bool has_no_foreground () const noexcept
{
return cell_noforeground_p (&_cell);
}
bool is_wide_right () const noexcept bool is_wide_right () const noexcept
{ {
return cell_wide_right_p (&_cell); return cell_wide_right_p (&_cell);

View File

@ -1012,12 +1012,6 @@ namespace ncpp
return error_guard (ncplane_rotate_ccw (plane), -1); return error_guard (ncplane_rotate_ccw (plane), -1);
} }
// Upstream call doesn't take ncplane* but we put it here for parity with has_no_background below
bool has_no_foreground (Cell &cell) const noexcept
{
return cell.has_no_foreground ();
}
const char* get_extended_gcluster (Cell &cell) const noexcept const char* get_extended_gcluster (Cell &cell) const noexcept
{ {
return cell_extended_gcluster (plane, cell); return cell_extended_gcluster (plane, cell);

View File

@ -50,12 +50,12 @@ struct ncfadectx; // context for a palette fade operation
typedef enum { typedef enum {
NCBLIT_DEFAULT, // let the ncvisual pick NCBLIT_DEFAULT, // let the ncvisual pick
NCBLIT_1x1, // full block █ NCBLIT_1x1, // full block █
NCBLIT_2x1, // full/(upper|left) blocks ▄ NCBLIT_2x1, // upper half + 1x1 ▀
NCBLIT_1x1x4, // shaded full blocks ▓▒░█ NCBLIT_1x1x4, // shaded full blocks ▓▒░█
NCBLIT_2x2, // quadrants ▗▐ ▖▄▟▌▙█ NCBLIT_2x2, // quadrants + 2x1 ▗▐ ▖▀▟▌▙█
NCBLIT_4x1, // four vert/horz levels █▆▄▂ / ▎▌▊█ NCBLIT_4x1, // four vertical levels █▆▄▂
NCBLIT_BRAILLE, // 4 rows, 2 cols (braille) ⡀⡄⡆⡇⢀⣀⣄⣆⣇⢠⣠⣤⣦⣧⢰⣰⣴⣶⣷⢸⣸⣼⣾⣿ NCBLIT_BRAILLE, // 4 rows, 2 cols (braille) ⡀⡄⡆⡇⢀⣀⣄⣆⣇⢠⣠⣤⣦⣧⢰⣰⣴⣶⣷⢸⣸⣼⣾⣿
NCBLIT_8x1, // eight vert/horz levels █▇▆▅▄▃▂▁ / ▏▎▍▌▋▊▉█ NCBLIT_8x1, // eight vertical levels █▇▆▅▄▃▂▁
NCBLIT_SIXEL, // 6 rows, 1 col (RGB), spotty support among terminals NCBLIT_SIXEL, // 6 rows, 1 col (RGB), spotty support among terminals
} ncblitter_e; } ncblitter_e;
@ -780,14 +780,6 @@ cellcmp(const struct ncplane* n1, const cell* RESTRICT c1,
return strcmp(cell_extended_gcluster(n1, c1), cell_extended_gcluster(n2, c2)); return strcmp(cell_extended_gcluster(n1, c1), cell_extended_gcluster(n2, c2));
} }
// True if the cell does not generate foreground pixels (i.e., the cell is
// entirely whitespace or special characters).
// FIXME do this at cell prep time and set a bit in the channels
static inline bool
cell_noforeground_p(const cell* c){
return cell_simple_p(c) && (c->gcluster == ' ' || !isprint(c->gcluster));
}
static inline int static inline int
cell_load_simple(struct ncplane* n, cell* c, char ch){ cell_load_simple(struct ncplane* n, cell* c, char ch){
cell_release(n, c); cell_release(n, c);

View File

@ -599,14 +599,6 @@ plane_debug(const ncplane* n, bool details){
} }
} }
// True if the cell does not generate background pixels. Only the FULL BLOCK
// glyph has this property, AFAIK.
// FIXME set a bit, doing this at load time
static inline bool
cell_nobackground_p(const egcpool* e, const cell* c){
return !cell_simple_p(c) && !strcmp(egcpool_extended_gcluster(e, c), "\xe2\x96\x88");
}
static inline void static inline void
pool_release(egcpool* pool, cell* c){ pool_release(egcpool* pool, cell* c){
if(!cell_simple_p(c)){ if(!cell_simple_p(c)){

View File

@ -756,6 +756,22 @@ stage_cursor(notcurses* nc, FILE* out, int y, int x){
return ret; return ret;
} }
// True if the cell does not generate background pixels. Only the FULL BLOCK
// glyph has this property, AFAIK.
// FIXME set a bit, doing this at load time
static inline bool
cell_nobackground_p(const egcpool* e, const cell* c){
return !cell_simple_p(c) && !strcmp(egcpool_extended_gcluster(e, c), "\xe2\x96\x88");
}
// True if the cell does not generate foreground pixels (i.e., the cell is
// entirely whitespace or special characters).
// FIXME do this at cell prep time and set a bit in the channels
static inline bool
cell_noforeground_p(const cell* c){
return cell_simple_p(c) && (c->gcluster == ' ' || !isprint(c->gcluster));
}
// Producing the frame requires three steps: // Producing the frame requires three steps:
// * render -- build up a flat framebuffer from a set of ncplanes // * render -- build up a flat framebuffer from a set of ncplanes
// * rasterize -- build up a UTF-8/ASCII stream of escapes and EGCs // * rasterize -- build up a UTF-8/ASCII stream of escapes and EGCs