add NCVISUAL_OPTION_NOINTERPOLATE #1576

This commit is contained in:
nick black 2021-06-08 01:09:15 -04:00 committed by Nick Black
parent 617071cf2c
commit a6433caeaa
6 changed files with 24 additions and 21 deletions

View File

@ -3183,12 +3183,13 @@ int notcurses_lex_blitter(const char* op, ncblitter_e* blitter);
// Get the name of a blitter. // Get the name of a blitter.
const char* notcurses_str_blitter(ncblitter_e blitter); const char* notcurses_str_blitter(ncblitter_e blitter);
#define NCVISUAL_OPTION_NODEGRADE 0x0001ull // fail rather than degrade #define NCVISUAL_OPTION_NODEGRADE 0x0001ull // fail rather than degrade
#define NCVISUAL_OPTION_BLEND 0x0002ull // use CELL_ALPHA_BLEND with visual #define NCVISUAL_OPTION_BLEND 0x0002ull // use CELL_ALPHA_BLEND
#define NCVISUAL_OPTION_HORALIGNED 0x0004ull // x is an alignment, not absolute #define NCVISUAL_OPTION_HORALIGNED 0x0004ull // x is an alignment, not abs
#define NCVISUAL_OPTION_VERALIGNED 0x0008ull // y is an alignment, not absolute #define NCVISUAL_OPTION_VERALIGNED 0x0008ull // y is an alignment, not abs
#define NCVISUAL_OPTION_ADDALPHA 0x0010ull // transcolor is transparent #define NCVISUAL_OPTION_ADDALPHA 0x0010ull // transcolor is in effect
#define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // new plane is child of n #define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // interpret n as parent
#define NCVISUAL_OPTION_NOINTERPOLATE 0x0040ull // non-interpolative scaling
struct ncvisual_options { struct ncvisual_options {
// if no ncplane is provided, one will be created using the exact size // if no ncplane is provided, one will be created using the exact size

View File

@ -30,12 +30,13 @@ typedef enum {
NCBLIT_8x1, // eight vertical levels, (plots) NCBLIT_8x1, // eight vertical levels, (plots)
} ncblitter_e; } ncblitter_e;
#define NCVISUAL_OPTION_NODEGRADE 0x0001 #define NCVISUAL_OPTION_NODEGRADE 0x0001ull
#define NCVISUAL_OPTION_BLEND 0x0002 #define NCVISUAL_OPTION_BLEND 0x0002ull
#define NCVISUAL_OPTION_HORALIGNED 0x0004 #define NCVISUAL_OPTION_HORALIGNED 0x0004ull
#define NCVISUAL_OPTION_VERALIGNED 0x0008 #define NCVISUAL_OPTION_VERALIGNED 0x0008ull
#define NCVISUAL_OPTION_ADDALPHA 0x0010 #define NCVISUAL_OPTION_ADDALPHA 0x0010ull
#define NCVISUAL_OPTION_CHILDPLANE 0x0020 #define NCVISUAL_OPTION_CHILDPLANE 0x0020ull
#define NCVISUAL_OPTION_NOINTERPOLATE 0x0040ull
struct ncvisual_options { struct ncvisual_options {
struct ncplane* n; struct ncplane* n;

View File

@ -2443,12 +2443,13 @@ API ALLOC struct ncvisual* ncvisual_from_plane(const struct ncplane* n,
int begy, int begx, int begy, int begx,
int leny, int lenx); int leny, int lenx);
#define NCVISUAL_OPTION_NODEGRADE 0x0001ull // fail rather than degrade #define NCVISUAL_OPTION_NODEGRADE 0x0001ull // fail rather than degrade
#define NCVISUAL_OPTION_BLEND 0x0002ull // use CELL_ALPHA_BLEND with visual #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_HORALIGNED 0x0004ull // x is an alignment, not absolute
#define NCVISUAL_OPTION_VERALIGNED 0x0008ull // y 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_ADDALPHA 0x0010ull // transcolor is in effect
#define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // interpret n as parent #define NCVISUAL_OPTION_CHILDPLANE 0x0020ull // interpret n as parent
#define NCVISUAL_OPTION_NOINTERPOLATE 0x0040ull // non-interpolative scaling
struct ncvisual_options { struct ncvisual_options {
// if no ncplane is provided, one will be created using the exact size // if no ncplane is provided, one will be created using the exact size

View File

@ -3,7 +3,7 @@ use libnotcurses_sys::*;
fn main() -> NcResult<()> { fn main() -> NcResult<()> {
let mut nc = Notcurses::new()?; 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); let chan_green = NcChannelPair::with_rgb(0x224411, 0x229922);
// FIXME: this doesn't show at all :/ // FIXME: this doesn't show at all :/

View File

@ -1366,7 +1366,7 @@ int ncpile_render(ncplane* n){
if(engorge_crender_vector(pile)){ if(engorge_crender_vector(pile)){
return -1; 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, ncpile_render_internal(n, pile->crender, pile->dimy, pile->dimx,
notcurses_stdplane(nc)->absy, notcurses_stdplane(nc)->absy,
notcurses_stdplane(nc)->absx); notcurses_stdplane(nc)->absx);

View File

@ -139,7 +139,7 @@ int ncvisual_blitset_geom(const notcurses* nc, const tinfo* tcache,
if(lenx == NULL){ if(lenx == NULL){
lenx = &fakelenx; 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); logwarn(nc, "Warning: unknown ncvisual options %016jx\n", (uintmax_t)vopts->flags);
} }
if(vopts && (vopts->flags & NCVISUAL_OPTION_CHILDPLANE) && !vopts->n){ if(vopts && (vopts->flags & NCVISUAL_OPTION_CHILDPLANE) && !vopts->n){