mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
sexblitter: purge NCBLIT_1x1x4, add NCBLIT_3x2 #1071
This commit is contained in:
parent
3e75b1e090
commit
8d66938a0e
@ -18,14 +18,14 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
NCBLIT_DEFAULT, // let the ncvisual pick
|
||||
NCBLIT_1x1, // full block █
|
||||
NCBLIT_2x1, // upper half + 1x1 ▀█
|
||||
NCBLIT_1x1x4, // shaded full blocks ▓▒░█
|
||||
NCBLIT_2x2, // quadrants + 2x1 ▗▐ ▖▀▟▌▙█
|
||||
NCBLIT_4x1, // four vertical levels █▆▄▂
|
||||
NCBLIT_BRAILLE, // 4 rows, 2 cols (braille) ⡀⡄⡆⡇⢀⣀⣄⣆⣇⢠⣠⣤⣦⣧⢰⣰⣴⣶⣷⢸⣸⣼⣾⣿
|
||||
NCBLIT_8x1, // eight vertical levels █▇▆▅▄▃▂▁
|
||||
NCBLIT_SIXEL, // 6 rows, 1 col (RGB), spotty support among terminals
|
||||
NCBLIT_1x1, // spaces only
|
||||
NCBLIT_2x1, // halves + 1x1
|
||||
NCBLIT_2x2, // quadrants + 2x1
|
||||
NCBLIT_3x2, // sextants + 1x1
|
||||
NCBLIT_4x1, // four vertical levels
|
||||
NCBLIT_BRAILLE, // 4 rows, 2 cols (braille)
|
||||
NCBLIT_8x1, // eight vertical levels
|
||||
NCBLIT_SIXEL, // 6 rows, 1 col (RGB)
|
||||
} ncblitter_e;
|
||||
|
||||
#define NCVISUAL_OPTION_NODEGRADE 0x0001
|
||||
@ -37,7 +37,7 @@ struct ncvisual_options {
|
||||
int y, x;
|
||||
int begy, begx; // origin of rendered section
|
||||
int leny, lenx; // size of rendered section
|
||||
ncblitter_e blitter; // glyph set to use (maps input to output cells)
|
||||
ncblitter_e blitter; // glyph set to use
|
||||
uint64_t flags; // bitmask over NCVISUAL_OPTION_*
|
||||
};
|
||||
|
||||
@ -147,10 +147,10 @@ geometry of same. **flags** is a bitfield over:
|
||||
The different **ncblitter_e** values select from among available glyph sets:
|
||||
|
||||
* **NCBLIT_DEFAULT**: Let the **ncvisual** choose its own blitter.
|
||||
* **NCBLIT_1x1**: Full block (█) or empty glyph.
|
||||
* **NCBLIT_2x1**: Adds the lower half block (▄) to **NCBLIT_1x1**.
|
||||
* **NCBLIT_1x1x4**: Adds three shaded full blocks (▓▒░) to **NCBLIT_1x1**.
|
||||
* **NCBLIT_1x1**: Spaces only. Works in ASCII, unlike other blitters.
|
||||
* **NCBLIT_2x1**: Adds the half blocks (▄▀) to **NCBLIT_1x1**.
|
||||
* **NCBLIT_2x2**: Adds left and right half blocks (▌▐) and quadrants (▖▗▟▙) to **NCBLIT_2x1**.
|
||||
* **NCBLIT_3x2**: Adds sextants to **NCBLIT_1x1**.
|
||||
* **NCBLIT_4x1**: Adds ¼ and ¾ blocks (▂▆) to **NCBLIT_2x1**.
|
||||
* **NCBLIT_BRAILLE**: 4 rows and 2 columns of braille (⡀⡄⡆⡇⢀⣀⣄⣆⣇⢠⣠⣤⣦⣧⢰⣰⣴⣶⣷⢸⣸⣼⣾⣿).
|
||||
* **NCBLIT_8x1**: Adds ⅛, ⅜, ⅝, and ⅞ blocks (▇▅▃▁) to **NCBLIT_4x1**.
|
||||
|
@ -55,13 +55,13 @@ struct ncfadectx; // context for a palette fade operation
|
||||
// background set to the desired foreground.
|
||||
typedef enum {
|
||||
NCBLIT_DEFAULT, // let the ncvisual pick
|
||||
NCBLIT_1x1, // spaces, compatible with ASCII
|
||||
NCBLIT_2x1, // upper half + 1x1 (space) ▀
|
||||
NCBLIT_1x1x4, // shaded full blocks ▓▒░█
|
||||
NCBLIT_2x2, // quadrants + 2x1 ▗▐ ▖▀▟▌▙█
|
||||
NCBLIT_4x1, // four vertical levels █▆▄▂
|
||||
NCBLIT_BRAILLE, // 4 rows, 2 cols (braille) ⡀⡄⡆⡇⢀⣀⣄⣆⣇⢠⣠⣤⣦⣧⢰⣰⣴⣶⣷⢸⣸⣼⣾⣿
|
||||
NCBLIT_8x1, // eight vertical levels █▇▆▅▄▃▂▁
|
||||
NCBLIT_1x1, // space, compatible with ASCII
|
||||
NCBLIT_2x1, // halves + 1x1 (space) ▄▀
|
||||
NCBLIT_2x2, // quadrants + 2x1 ▗▐ ▖▀▟▌▙█
|
||||
NCBLIT_3x2, // sextants (*NOT* 2x2) 🬀🬁🬂🬃🬄🬅🬆🬇🬈🬉🬊🬋🬌🬍🬎🬏🬐🬑🬒🬓🬔🬕🬖🬗🬘🬙🬚🬛🬜🬝🬞🬟🬠🬡🬢🬣🬤🬥🬦🬧🬨🬩🬪🬫🬬🬭🬮🬯🬰🬱🬲🬳🬴🬵🬶🬷🬸🬹🬺🬻
|
||||
NCBLIT_4x1, // four vertical levels █▆▄▂
|
||||
NCBLIT_BRAILLE, // 4 rows, 2 cols (braille) ⡀⡄⡆⡇⢀⣀⣄⣆⣇⢠⣠⣤⣦⣧⢰⣰⣴⣶⣷⢸⣸⣼⣾⣿
|
||||
NCBLIT_8x1, // eight vertical levels █▇▆▅▄▃▂▁
|
||||
NCBLIT_SIXEL, // 6 rows, 1 col (RGB), spotty support among terminals
|
||||
} ncblitter_e;
|
||||
|
||||
|
@ -448,6 +448,15 @@ quadrant_blit(ncplane* nc, int placey, int placex, int linesize,
|
||||
return total;
|
||||
}
|
||||
|
||||
// quadrant blitter. maps 2x2 to each cell. since we only have two colors at
|
||||
// our disposal (foreground and background), we lose some fidelity.
|
||||
static inline int
|
||||
sextant_blit(ncplane* nc, int placey, int placex, int linesize,
|
||||
const void* data, int begy, int begx,
|
||||
int leny, int lenx, bool bgr, bool blendcolors){
|
||||
return 0;
|
||||
}
|
||||
|
||||
// fold the r, g, and b components of the pixel into *r, *g, and *b, and
|
||||
// increment *foldcount
|
||||
static inline void
|
||||
@ -592,10 +601,10 @@ const struct blitset notcurses_blitters[] = {
|
||||
.blit = tria_blit_ascii,.name = "ascii", .fill = false, },
|
||||
{ .geom = NCBLIT_2x1, .width = 1, .height = 2, .egcs = L" ▄█",
|
||||
.blit = tria_blit, .name = "halfblock", .fill = false, },
|
||||
{ .geom = NCBLIT_1x1x4, .width = 1, .height = 4, .egcs = L" ▒░▓█",
|
||||
.blit = tria_blit, .name = "shadeblocks", .fill = false, },
|
||||
{ .geom = NCBLIT_2x2, .width = 2, .height = 2, .egcs = L" ▗▐▖▄▟▌▙█",
|
||||
.blit = quadrant_blit, .name = "quadblitter", .fill = false, },
|
||||
{ .geom = NCBLIT_3x2, .width = 2, .height = 3, .egcs = L" 🬀🬁🬂🬃🬄🬅🬆🬇🬈🬉🬊🬋🬌🬍🬎🬏🬐🬑🬒🬓🬔🬕🬖🬗🬘🬙🬚🬛🬜🬝🬞🬟🬠🬡🬢🬣🬤🬥🬦🬧🬨🬩🬪🬫🬬🬭🬮🬯🬰🬱🬲🬳🬴🬵🬶🬷🬸🬹🬺🬻█",
|
||||
.blit = sextant_blit, .name = "hexblitter", .fill = false, },
|
||||
{ .geom = NCBLIT_4x1, .width = 1, .height = 4, .egcs = L" ▂▄▆█",
|
||||
.blit = tria_blit, .name = "fourstep", .fill = false, },
|
||||
{ .geom = NCBLIT_BRAILLE, .width = 2, .height = 4, .egcs = L"⠀⢀⢠⢰⢸⡀⣀⣠⣰⣸⡄⣄⣤⣴⣼⡆⣆⣦⣶⣾⡇⣇⣧⣷⣿",
|
||||
|
Loading…
x
Reference in New Issue
Block a user