|
|
|
@ -14,26 +14,26 @@ visualize(struct notcurses* nc, struct ncvisual* ncv){
|
|
|
|
|
struct ncvisual_options vopts = {
|
|
|
|
|
.scaling = NCSCALE_STRETCH,
|
|
|
|
|
.blitter = bs[i],
|
|
|
|
|
.n = notcurses_stdplane(nc),
|
|
|
|
|
};
|
|
|
|
|
struct ncplane* n = ncvisual_render(nc, ncv, &vopts);
|
|
|
|
|
if(n == NULL){
|
|
|
|
|
if(ncvisual_render(nc, ncv, &vopts) == NULL){
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
ncplane_set_fg_rgb(vopts.n, 0xffffff);
|
|
|
|
|
ncplane_set_bg_rgb(vopts.n, 0);
|
|
|
|
|
const char* name = notcurses_str_blitter(bs[i]);
|
|
|
|
|
ncplane_set_bg_rgb(n, 0);
|
|
|
|
|
int scalex, scaley, truey, truex;
|
|
|
|
|
ncvisual_geom(nc, ncv, &vopts, &truey, &truex, &scaley, &scalex);
|
|
|
|
|
ncplane_printf_aligned(n, ncplane_dim_y(n) / 2 - 1, NCALIGN_CENTER,
|
|
|
|
|
ncplane_printf_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2 - 1, NCALIGN_CENTER,
|
|
|
|
|
"%dx%d", truex, truey);
|
|
|
|
|
ncplane_putstr_aligned(n, ncplane_dim_y(n) / 2, NCALIGN_CENTER, name);
|
|
|
|
|
ncplane_printf_aligned(n, ncplane_dim_y(n) / 2 + 1, NCALIGN_CENTER,
|
|
|
|
|
ncplane_putstr_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2, NCALIGN_CENTER, name);
|
|
|
|
|
ncplane_printf_aligned(vopts.n, ncplane_dim_y(vopts.n) / 2 + 1, NCALIGN_CENTER,
|
|
|
|
|
"%d:%d pixels -> cell", scalex, scaley);
|
|
|
|
|
int ret = demo_render(nc);
|
|
|
|
|
if(ret){
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
ret = demo_nanosleep(nc, &demodelay);
|
|
|
|
|
ncplane_destroy(n);
|
|
|
|
|
if(ret){
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
@ -45,7 +45,11 @@ int keller_demo(struct notcurses* nc){
|
|
|
|
|
if(!notcurses_canopen_images(nc)){
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
const char* files[] = { "covid19.jpg", "aidsrobots.jpeg", "atma.png", "fonts.jpg", NULL, };
|
|
|
|
|
// don't leave whatever random stuff was up behind covid19 (braille is always
|
|
|
|
|
// to a degree transparent), but *do* leave things up between phases--the
|
|
|
|
|
// combined braille of covid19+atma looks subtly cool.
|
|
|
|
|
ncplane_erase(notcurses_stdplane(nc));
|
|
|
|
|
const char* files[] = { "covid19.jpg", "atma.png", "fonts.jpg", "aidsrobots.jpeg", NULL, };
|
|
|
|
|
for(const char** file = files ; *file ; ++file){
|
|
|
|
|
char* f = find_data(*file);
|
|
|
|
|
if(f == NULL){
|
|
|
|
|