From 70059297c021fef1bca99db1c01652ae9bb65bac Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 14 Mar 2021 23:16:29 -0400 Subject: [PATCH] notcurses_direct.3: add image render+raster to docs --- USAGE.md | 13 +++++++++++++ doc/man/man3/notcurses_direct.3.md | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/USAGE.md b/USAGE.md index cd85ca3dc..38dd718ef 100644 --- a/USAGE.md +++ b/USAGE.md @@ -453,6 +453,19 @@ int ncdirect_double_box(struct ncdirect* n, uint64_t ul, uint64_t ur, // the column of the cursor, and those to the right. int ncdirect_render_image(struct ncdirect* nc, const char* filename, ncblitter_e blitter, ncscale_e scale); + +// Render an image using the specified blitter and scaling, but do not write +// the result. The image may be arbitrarily many rows -- the output will scroll +// -- but will only occupy the column of the cursor, and those to the right. +// To actually write (and free) this, invoke ncdirect_raster_frame(). 'maxx' +// and 'maxy', if greater than 0, are used for scaling; the terminal's geometry +// is otherwise used. +ncdirectv* ncdirect_render_frame(struct ncdirect* n, const char* filename, + ncblitter_e blitter, ncscale_e scale, + int maxy, int maxx); + +// Takes the result of ncdirect_render_frame() and writes it to the output. +int ncdirect_raster_frame(struct ncdirect* n, ncdirectv* ncdv, ncalign_e align); ``` Several of the Notcurses capability predicates have `ncdirect` analogues: diff --git a/doc/man/man3/notcurses_direct.3.md b/doc/man/man3/notcurses_direct.3.md index 61bbae5e8..2bfc7ded8 100644 --- a/doc/man/man3/notcurses_direct.3.md +++ b/doc/man/man3/notcurses_direct.3.md @@ -86,6 +86,10 @@ notcurses_direct - minimal notcurses instances for styling text **int ncdirect_render_image(struct ncdirect* ***n***, const char* ***filename***, ncblitter_e ***blitter***, ncscale_e ***scale***);** +**ncdirectv* ncdirect_render_frame(struct ncdirect* ***n***, const char* ***filename***, ncblitter_e ***blitter***, ncscale_e ***scale***, int ***maxy***, int ***maxx***);** + +**int ncdirect_raster_frame(struct ncdirect* ***n***, ncdirectv* ***ncdv***, ncalign_e ***align***);** + **char* ncdirect_readline(struct ncdirect* ***n***, const char* ***prompt***);** # DESCRIPTION