notcurses_lines(3)
πΈ notcurses_lines(3): operations on lines and boxes πΈ
okay bestie, welcome to the notcurses_lines(3) manual π
this one is literally all about lines and boxes, no cap. itβs giving terminal arts-and-crafts, and weβre obsessed π
β¨ NAME β¨
notcurses_lines β operations on lines and boxes
π SYNOPSIS π
okay so first you include the header, then you get the whole cast of functions and defines exactly like this π
#include <notcurses/notcurses.h>
int ncplane_hline_interp(struct ncplane* n, const nccell* c, unsigned len, uint64_t c1, uint64_t c2);
static inline int ncplane_hline(struct ncplane* n, const nccell* c, unsigned len);
int ncplane_vline_interp(struct ncplane* n, const nccell* c, unsigned len, uint64_t c1, uint64_t c2);
static inline int ncplane_vline(struct ncplane* n, const nccell* c, unsigned len);
#define NCBOXMASK_TOP 0x0001
#define NCBOXMASK_RIGHT 0x0002
#define NCBOXMASK_BOTTOM 0x0004
#define NCBOXMASK_LEFT 0x0008
#define NCBOXGRAD_TOP 0x0010
#define NCBOXGRAD_RIGHT 0x0020
#define NCBOXGRAD_BOTTOM 0x0040
#define NCBOXGRAD_LEFT 0x0080
#define NCBOXCORNER_MASK 0x0300
#define NCBOXCORNER_SHIFT 8u
int ncplane_box(struct ncplane* n, const nccell* ul, const nccell* ur, const nccell* ll, const nccell* lr, const nccell* hline, const nccell* vline, int ystop, int xstop, unsigned ctlword);
static inline int ncplane_box_sized(struct ncplane* n, const nccell* ul, const nccell* ur, const nccell* ll, const nccell* lr, const nccell* hline, const nccell* vline, int ylen, int xlen, unsigned ctlword);
static inline int ncplane_perimeter(struct ncplane* n, const nccell* ul, const nccell* ur, const nccell* ll, const nccell* lr, const nccell* hline, const nccell* vline, unsigned ctlword)
static inline int nccells_load_box(struct ncplane* n, uint16_t styles, uint64_t channels, nccell* ul, nccell* ur, nccell* ll, nccell* lr, nccell* hl, nccell* vl, const char* gclusters);
static inline int nccells_rounded_box(struct ncplane* n, uint16_t styles, uint64_t channels, nccell* ul, nccell* ur, nccell* ll, nccell* lr, nccell* hl, nccell* vl);
static inline int ncplane_rounded_box(struct ncplane* n, uint16_t styles, uint64_t channels, int ystop, int xstop, unsigned ctlword);
static inline int ncplane_rounded_box_sized(struct ncplane* n, uint16_t styles, uint64_t channels, int ylen, int xlen, unsigned ctlword);
static inline int nccells_double_box(struct ncplane* n, uint16_t styles, uint64_t channels, nccell* ul, nccell* ur, nccell* ll, nccell* lr, nccell* hl, nccell* vl);
static inline int ncplane_double_box(struct ncplane* n, uint16_t styles, uint64_t channels, int ystop, int xstop, unsigned ctlword);
static inline int ncplane_double_box_sized(struct ncplane* n, uint16_t styles, uint64_t channels, int ylen, int xlen, unsigned ctlword);
int ncplane_polyfill_yx(struct ncplane* n, unsigned y, unsigned x, const nccell* c);
int ncplane_gradient(struct ncplane* n, int y, int x, unsigned ylen, unsigned xlen, const char* egc, uint16_t stylemask, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr);
int ncplane_highgradient2x1(struct ncplane* n, int y, int x, unsigned ylen, unsigned xlen, uint32_t ul, uint32_t ur, uint32_t ll, uint32_t lr);
int ncplane_format(struct ncplane* n, int y, int x, unsigned ylen, unsigned xlen, uint16_t stylemask);
int ncplane_stain(struct ncplane* n, int y, int x, unsigned ylen, unsigned xlen, uint64_t ul, uint64_t ur, uint64_t ll, uint64_t lr);
thatβs the whole lineup, no cuts, periodt β¨
π DESCRIPTION π
ncplane_polyfill_yxβ starts at the specifiedyandx(provide-1to use the cursorβs position in the relevant dimension). the cell at these coordinates is replaced withc. all connected cells having the same content as this original cell are replaced withc, recursively. two cells are connected if they are vertical or horizontal neighbors of one another π«Άncplane_gradientβ replaces all glyphs in the specified area withegc, and colors them with the specified gradient. all content within the specified area is destroyed πncplane_gradient2x1β draws a high-definition gradient in the specified area. it will return an error ifUTF8is not being used. the gradient is drawn using theUPPER HALF BLOCKglyph, with two vertical steps and one horizontal step in each cell. since cells are often about twice as tall as they are wide, this tends to result in very even color differences. all content within the specified area is destroyed π
yes bestie, the DESCRIPTION saysncplane_gradient2x1while the SYNOPSIS saysncplane_highgradient2x1β Iβm keeping both exactly as the page gives them, no edits from me π
ncplane_formatβ sets the attributes of every cell in the region having its upper-left corner atyandx(provide-1to use the cursorβs position in the relevant dimension), and its area defined byylenandxlen(provide0to use all remaining area to the right and below, respectively). channels and glyphs will be unaffected πΈncplane_stainβ works the same way, but sets channels. standard linear interpolation is applied between the provided corner channels. glyphs and their attributes will be unaffected π
box- and line-drawing is unaffected by a planeβs scrolling status π¦
π¦ RETURN VALUES π¦
ncplane_format,ncplane_stain,ncplane_gradient,ncplane_gradient2x1, andncplane_polyfill_yxreturn-1if any coordinates are outside the plane, and otherwise the number of cells affected π₯ncplane_hline_interp,ncplane_hline,ncplane_vline_interp, andncplane_vlineall return the number of glyphs drawn on success, or-1on failure. passing a length of0is an error π
π SEE ALSO π
π AUTHORS π
nick black nickblack@linux.com β the icon behind the lines and boxes π
π bye bestie β this was notcurses_lines(3), version v3.0.17 π
π¦ where this page comes from
- alpine 3.24: notcurses-doc 3.0.17-r0 Β· Apache-2.0
- ubuntu resolute: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- ubuntu stonking: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms