From 38a5e16f8521fc385a5e14a9063dcaa2f1a5f019 Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 31 Mar 2021 04:01:19 -0400 Subject: [PATCH] [raster] second pass on sprixel rasterization #1487 --- doc/man/man1/ncplayer.1.md | 3 +-- src/lib/render.c | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/man/man1/ncplayer.1.md b/doc/man/man1/ncplayer.1.md index 432f13c0f..b0febe2a0 100644 --- a/doc/man/man1/ncplayer.1.md +++ b/doc/man/man1/ncplayer.1.md @@ -51,8 +51,7 @@ Default margins are all 0 and default scaling is **stretch**. The full rendering area will thus be used. Using **-m**, margins can be supplied. Provide a single number to set all four margins to the same value, or four comma-delimited values for the top, right, bottom, and left margins -respectively. Top and bottom margins are ignored when **-k** is used. Negative -margins are illegal. +respectively. Negative margins are illegal. Scaling mode **stretch** resizes the object to match the target rendering area exactly. Unless a blitter is specified with **-b**, **stretch** will use diff --git a/src/lib/render.c b/src/lib/render.c index a2072ba8c..6cadd7625 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -941,7 +941,7 @@ rasterize_sprixels(notcurses* nc, const ncpile* p, FILE* out){ ncplane_yx(s->n, &y, &x); y += s->y; x += s->x; -//fprintf(stderr, "DRAWING BITMAP %d AT %d/%d for %p\n", s->id, y + nc->stdplane->absy, x + nc->stdplane->absx, s->n); +fprintf(stderr, "DRAWING BITMAP %d AT %d/%d for %p\n", s->id, y + nc->stdplane->absy, x + nc->stdplane->absx, s->n); if(goto_location(nc, out, y + nc->stdplane->absy, x + nc->stdplane->absx)){ return -1; } @@ -952,7 +952,7 @@ rasterize_sprixels(notcurses* nc, const ncpile* p, FILE* out){ nc->rstate.hardcursorpos = true; parent = &s->next; }else if(s->invalidated == SPRIXEL_HIDE){ -//fprintf(stderr, "OUGHT HIDE %d [%dx%d @ %d/%d] %p\n", s->id, s->dimy, s->dimx, s->y, s->x, s); +fprintf(stderr, "OUGHT HIDE %d [%dx%d @ %d/%d] %p\n", s->id, s->dimy, s->dimx, s->y, s->x, s); int r = sprite_destroy(nc, p, out, s); if(r < 0){ return -1; @@ -1105,6 +1105,9 @@ notcurses_rasterize_inner(notcurses* nc, const ncpile* p, FILE* out){ if(rasterize_core(nc, p, out)){ return -1; } + if(rasterize_sprixels(nc, p, out) < 0){ + return -1; + } if(fflush(out)){ return -1; }