@ -51,6 +51,16 @@ struct ncvisual_options {
};
};
typedef int (*streamcb)(struct notcurses*, struct ncvisual*, void*);
typedef int (*streamcb)(struct notcurses*, struct ncvisual*, void*);
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 (per visual_options)
int rcelly, rcellx; // rendered cell geometry (per visual_options)
int scaley, scalex; // pixels per filled cell (scale == c for bitmaps)
int maxpixely, maxpixelx; // only defined for NCBLIT_PIXEL
ncblitter_e blitter;// blitter that will be used
} ncvgeom;
```
```
**struct ncvisual* ncvisual_from_file(const char* ** *file***);**
**struct ncvisual* ncvisual_from_file(const char* ** *file***);**
@ -67,7 +77,7 @@ typedef int (*streamcb)(struct notcurses*, struct ncvisual*, void*);
**struct ncvisual* ncvisual_from_plane(struct ncplane* ** *n***, ncblitter_e ** *blit***, int ** *begy***, int ** *begx***, int ** *leny***, int ** *lenx***);**
**struct ncvisual* ncvisual_from_plane(struct ncplane* ** *n***, ncblitter_e ** *blit***, int ** *begy***, int ** *begx***, int ** *leny***, int ** *lenx***);**
**int ncvisual_blitter_ geom(const struct notcurses* ** *nc***, const struct ncvisual* ** *n***, const struct ncvisual_options* ** *vopts***, int* ** *y***, int* ** *x***, int* ** *scaley***, int* ** *scalex***, ncblitter_e* ** *blitter ***);**
**int ncvisual_geom(const struct notcurses* ** *nc***, const struct ncvisual* ** *n***, const struct ncvisual_options* ** *vopts***, ncvgeom* ** *geom ***);**
**void ncvisual_destroy(struct ncvisual* ** *ncv***);**
**void ncvisual_destroy(struct ncvisual* ** *ncv***);**
@ -177,9 +187,14 @@ geometry of same. ***flags*** is a bitfield over:
as a transparent color.
as a transparent color.
* **NCVISUAL_OPTION_CHILDPLANE** : Make a new plane, as a child of ** *n***.
* **NCVISUAL_OPTION_CHILDPLANE** : Make a new plane, as a child of ** *n***.
**ncvisual_blitter_geom** allows the caller to determine any or all of the
**ncvisual_geom** allows the caller to determine any or all of the visual's
visual's pixel geometry, the blitter to be used, and that blitter's scaling
pixel geometry, the blitter to be used, and that blitter's scaling in both
in both dimensions. Any but the first argument may be **NULL** .
dimensions. Any but the final argument may be **NULL** , though at least one
of ** *nc*** and ** *n*** must be non-**NULL**. If ** *nc*** is **NULL** ,
only properties intrinsic to the visual are returned (i.e. its original
pixel geometry). If ** *n*** is **NULL** , only properties independent of the
visual are returned (i.e. cell-pixel geometry and maximum bitmap geometry).
If both are supplied, all fields of the **ncvgeom** structure are filled in.
**ncplane_qrcode** draws an ISO/IEC 18004:2015 QR Code for the **len** bytes of
**ncplane_qrcode** draws an ISO/IEC 18004:2015 QR Code for the **len** bytes of
**data** using **NCBLIT_2x1** (this is the only blitter that will work with QR
**data** using **NCBLIT_2x1** (this is the only blitter that will work with QR
@ -317,7 +332,8 @@ which the visual was rendered. If **opts->n** is provided, this will be
**opts->n**. Otherwise, a plane will be created, perfectly sized for the
**opts->n**. Otherwise, a plane will be created, perfectly sized for the
visual and the specified blitter.
visual and the specified blitter.
**ncvisual_blitter_geom** returns non-zero if the specified blitter is invalid.
**ncvisual_geom** returns non-zero if the specified configuration is invalid,
or if both ** *nc*** and ** *n*** are **NULL** .
**ncvisual_media_defblitter** returns the blitter selected by **NCBLIT_DEFAULT**
**ncvisual_media_defblitter** returns the blitter selected by **NCBLIT_DEFAULT**
in the specified configuration. If UTF8 is not enabled, this will always be
in the specified configuration. If UTF8 is not enabled, this will always be
@ -358,7 +374,7 @@ When using non-interpolative blitting together with scaling, unless your goal
includes minimizing the total area required, lower-resolution blitters will
includes minimizing the total area required, lower-resolution blitters will
generally look just as good as higher resolution blitters, and be faster.
generally look just as good as higher resolution blitters, and be faster.
The results of **ncvisual_ blitter_ geom** are invalidated by a terminal resize.
The results of **ncvisual_ geom** are invalidated by a terminal resize.
# BUGS
# BUGS