ncdirectf_geom: approximate rcell{y,x} #1665

pull/1683/head
nick black 3 years ago
parent d3a1a16ec1
commit 8ff2499b44
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -336,7 +336,7 @@ typedef struct ncvgeom {
int pixy, pixx; // true pixel geometry of ncvisual data
int cdimy, cdimx; // terminal cell geometry when this was calculated
int rpixy, rpixx; // rendered pixel geometry
int rcelly, rcellx; // rendered cell geometry FIXME not yet filled in
int rcelly, rcellx; // rendered cell geometry
int scaley, scalex; // pixels per filled cell
// only defined for NCBLIT_PIXEL
int maxpixely, maxpixelx;

@ -1263,11 +1263,15 @@ int ncdirectf_geom(ncdirect* n, ncdirectf* frame,
geom->maxpixely = n->tcache.sixel_maxy;
geom->maxpixelx = n->tcache.sixel_maxx;
const struct blitset* bset;
geom->rcelly = geom->rcellx = -1; // FIXME
int r = ncvisual_blitset_geom(NULL, &n->tcache, frame, &vopts,
&geom->pixy, &geom->pixx,
&geom->scaley, &geom->scalex,
&geom->rpixy, &geom->rpixx, &bset);
// FIXME ncvisual_blitset_geom() ought calculate these two for us; until
// then, derive them ourselves. the row count might be short by one if
// we're using sixel, and we're not a multiple of 6
geom->rcelly = geom->pixy / geom->scaley;
geom->rcellx = geom->pixx / geom->scalex;
if(r == 0 && blitter){
*blitter = bset->geom;
}

Loading…
Cancel
Save