pixel PoC / ncneofetch -> ncvisual_blit() #1462

This commit is contained in:
nick black 2021-10-16 01:14:11 -04:00 committed by nick black
parent 5db0f3457b
commit 36646f1b9b
2 changed files with 6 additions and 3 deletions

View File

@ -607,12 +607,13 @@ display_thread(void* vmarshal){
pixeling = true;
}
struct ncvisual_options vopts = {
.n = notcurses_stdplane(m->nc),
.x = NCALIGN_CENTER,
.blitter = pixeling ? NCBLIT_PIXEL : NCBLIT_3x2,
.scaling = pixeling ? NCSCALE_NONE : NCSCALE_SCALE_HIRES,
.flags = NCVISUAL_OPTION_HORALIGNED,
.flags = NCVISUAL_OPTION_HORALIGNED | NCVISUAL_OPTION_CHILDPLANE,
};
struct ncplane* iplane = ncvisual_render(m->nc, ncv, &vopts);
struct ncplane* iplane = ncvisual_blit(m->nc, ncv, &vopts);
ncvisual_destroy(ncv);
if(iplane){
int x = ncplane_x(iplane);

View File

@ -15,12 +15,14 @@ handle(struct notcurses* nc, const char *fn){
uint64_t channels = NCCHANNELS_INITIALIZER(rand() % 256, rand() % 256, 100, rand() % 256, 100, 140);
ncplane_set_base(stdn, "a", 0, channels);
struct ncvisual_options vopts = {
.n = notcurses_stdplane(nc),
.y = y,
.x = x,
.scaling = NCSCALE_NONE_HIRES,
.blitter = NCBLIT_PIXEL,
.flags = NCVISUAL_OPTION_CHILDPLANE | NCVISUAL_OPTION_NODEGRADE,
};
struct ncplane* nv = ncvisual_render(nc, ncv, &vopts);
struct ncplane* nv = ncvisual_blit(nc, ncv, &vopts);
if(nv == NULL){
ncvisual_destroy(ncv);
return -1;