From a6433caeaa53893ca037eca28d3d7040e3628d16 Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 8 Jun 2021 01:09:15 -0400 Subject: [PATCH] add NCVISUAL_OPTION_NOINTERPOLATE #1576 --- USAGE.md | 13 +++++++------ doc/man/man3/notcurses_visual.3.md | 13 +++++++------ include/notcurses/notcurses.h | 13 +++++++------ rust/examples/issue-1732.rs | 2 +- src/lib/render.c | 2 +- src/lib/visual.c | 2 +- 6 files changed, 24 insertions(+), 21 deletions(-) diff --git a/USAGE.md b/USAGE.md index bb8f8ee12..892e4ad74 100644 --- a/USAGE.md +++ b/USAGE.md @@ -3183,12 +3183,13 @@ int notcurses_lex_blitter(const char* op, ncblitter_e* blitter); // Get the name of a blitter. const char* notcurses_str_blitter(ncblitter_e blitter); -#define NCVISUAL_OPTION_NODEGRADE 0x0001ull // fail rather than degrade -#define NCVISUAL_OPTION_BLEND 0x0002ull // use CELL_ALPHA_BLEND with visual -#define NCVISUAL_OPTION_HORALIGNED 0x0004ull // x is an alignment, not absolute -#define NCVISUAL_OPTION_VERALIGNED 0x0008ull // y is an alignment, not absolute -#define NCVISUAL_OPTION_ADDALPHA 0x0010ull // transcolor is transparent -#define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // new plane is child of n +#define NCVISUAL_OPTION_NODEGRADE 0x0001ull // fail rather than degrade +#define NCVISUAL_OPTION_BLEND 0x0002ull // use CELL_ALPHA_BLEND +#define NCVISUAL_OPTION_HORALIGNED 0x0004ull // x is an alignment, not abs +#define NCVISUAL_OPTION_VERALIGNED 0x0008ull // y is an alignment, not abs +#define NCVISUAL_OPTION_ADDALPHA 0x0010ull // transcolor is in effect +#define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // interpret n as parent +#define NCVISUAL_OPTION_NOINTERPOLATE 0x0040ull // non-interpolative scaling struct ncvisual_options { // if no ncplane is provided, one will be created using the exact size diff --git a/doc/man/man3/notcurses_visual.3.md b/doc/man/man3/notcurses_visual.3.md index 4479798a2..4d60450fa 100644 --- a/doc/man/man3/notcurses_visual.3.md +++ b/doc/man/man3/notcurses_visual.3.md @@ -30,12 +30,13 @@ typedef enum { NCBLIT_8x1, // eight vertical levels, (plots) } ncblitter_e; -#define NCVISUAL_OPTION_NODEGRADE 0x0001 -#define NCVISUAL_OPTION_BLEND 0x0002 -#define NCVISUAL_OPTION_HORALIGNED 0x0004 -#define NCVISUAL_OPTION_VERALIGNED 0x0008 -#define NCVISUAL_OPTION_ADDALPHA 0x0010 -#define NCVISUAL_OPTION_CHILDPLANE 0x0020 +#define NCVISUAL_OPTION_NODEGRADE 0x0001ull +#define NCVISUAL_OPTION_BLEND 0x0002ull +#define NCVISUAL_OPTION_HORALIGNED 0x0004ull +#define NCVISUAL_OPTION_VERALIGNED 0x0008ull +#define NCVISUAL_OPTION_ADDALPHA 0x0010ull +#define NCVISUAL_OPTION_CHILDPLANE 0x0020ull +#define NCVISUAL_OPTION_NOINTERPOLATE 0x0040ull struct ncvisual_options { struct ncplane* n; diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index 1c93d1bb2..3b043e194 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -2443,12 +2443,13 @@ API ALLOC struct ncvisual* ncvisual_from_plane(const struct ncplane* n, int begy, int begx, int leny, int lenx); -#define NCVISUAL_OPTION_NODEGRADE 0x0001ull // fail rather than degrade -#define NCVISUAL_OPTION_BLEND 0x0002ull // use CELL_ALPHA_BLEND with visual -#define NCVISUAL_OPTION_HORALIGNED 0x0004ull // x is an alignment, not absolute -#define NCVISUAL_OPTION_VERALIGNED 0x0008ull // y is an alignment, not absolute -#define NCVISUAL_OPTION_ADDALPHA 0x0010ull // transcolor is in effect -#define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // interpret n as parent +#define NCVISUAL_OPTION_NODEGRADE 0x0001ull // fail rather than degrade +#define NCVISUAL_OPTION_BLEND 0x0002ull // use CELL_ALPHA_BLEND with visual +#define NCVISUAL_OPTION_HORALIGNED 0x0004ull // x is an alignment, not absolute +#define NCVISUAL_OPTION_VERALIGNED 0x0008ull // y is an alignment, not absolute +#define NCVISUAL_OPTION_ADDALPHA 0x0010ull // transcolor is in effect +#define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // interpret n as parent +#define NCVISUAL_OPTION_NOINTERPOLATE 0x0040ull // non-interpolative scaling struct ncvisual_options { // if no ncplane is provided, one will be created using the exact size diff --git a/rust/examples/issue-1732.rs b/rust/examples/issue-1732.rs index 650040006..1b171827d 100644 --- a/rust/examples/issue-1732.rs +++ b/rust/examples/issue-1732.rs @@ -3,7 +3,7 @@ use libnotcurses_sys::*; fn main() -> NcResult<()> { let mut nc = Notcurses::new()?; - let chan_blue = NcChannelPair::with_rgb(0x88aa00, 0x2222287); + let chan_blue = NcChannelPair::with_rgb(0x88aa00, 0x22287); let chan_green = NcChannelPair::with_rgb(0x224411, 0x229922); // FIXME: this doesn't show at all :/ diff --git a/src/lib/render.c b/src/lib/render.c index 9696b7f8f..b4d878896 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -1366,7 +1366,7 @@ int ncpile_render(ncplane* n){ if(engorge_crender_vector(pile)){ return -1; } - // FIXME notcurses_stdplane() doesn't belong here + // FIXME notcurses_stdplane() doesn't belong here #1615 ncpile_render_internal(n, pile->crender, pile->dimy, pile->dimx, notcurses_stdplane(nc)->absy, notcurses_stdplane(nc)->absx); diff --git a/src/lib/visual.c b/src/lib/visual.c index 80bf3dfa6..54531a82a 100644 --- a/src/lib/visual.c +++ b/src/lib/visual.c @@ -139,7 +139,7 @@ int ncvisual_blitset_geom(const notcurses* nc, const tinfo* tcache, if(lenx == NULL){ lenx = &fakelenx; } - if(vopts && vopts->flags >= (NCVISUAL_OPTION_CHILDPLANE << 1u)){ + if(vopts && vopts->flags >= (NCVISUAL_OPTION_NOINTERPOLATE << 1u)){ logwarn(nc, "Warning: unknown ncvisual options %016jx\n", (uintmax_t)vopts->flags); } if(vopts && (vopts->flags & NCVISUAL_OPTION_CHILDPLANE) && !vopts->n){