.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "notcurses_lines" "3" "v3.0.0" "" "" .hy .SH NAME .PP notcurses_lines - operations on lines and boxes .SH SYNOPSIS .PP \f[B]#include \f[R] .PP \f[B]int ncplane_hline_interp(struct ncplane* \f[R]\f[I]n\f[R]\f[B], const nccell* \f[R]\f[I]c\f[R]\f[B], unsigned \f[R]\f[I]len\f[R]\f[B], uint64_t \f[R]\f[I]c1\f[R]\f[B], uint64_t \f[R]\f[I]c2\f[R]\f[B]);\f[R] .PP \f[B]static inline int ncplane_hline(struct ncplane* \f[R]\f[I]n\f[R]\f[B], const nccell* \f[R]\f[I]c\f[R]\f[B], unsigned \f[R]\f[I]len\f[R]\f[B]);\f[R] .PP \f[B]int ncplane_vline_interp(struct ncplane* \f[R]\f[I]n\f[R]\f[B], const nccell* \f[R]\f[I]c\f[R]\f[B], unsigned \f[R]\f[I]len\f[R]\f[B], uint64_t \f[R]\f[I]c1\f[R]\f[B], uint64_t \f[R]\f[I]c2\f[R]\f[B]);\f[R] .PP \f[B]static inline int ncplane_vline(struct ncplane* \f[R]\f[I]n\f[R]\f[B], const nccell* \f[R]\f[I]c\f[R]\f[B], unsigned \f[R]\f[I]len\f[R]\f[B]);\f[R] .IP .nf \f[C] #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 \f[R] .fi .PP \f[B]int ncplane_box(struct ncplane* \f[R]\f[I]n\f[R]\f[B], const nccell* \f[R]\f[I]ul\f[R]\f[B], const nccell* \f[R]\f[I]ur\f[R]\f[B], const nccell* \f[R]\f[I]ll\f[R]\f[B], const nccell* \f[R]\f[I]lr\f[R]\f[B], const nccell* \f[R]\f[I]hline\f[R]\f[B], const nccell* \f[R]\f[I]vline\f[R]\f[B], int \f[R]\f[I]ystop\f[R]\f[B], int \f[R]\f[I]xstop\f[R]\f[B], unsigned \f[R]\f[I]ctlword\f[R]\f[B]);\f[R] .PP \f[B]static inline int ncplane_box_sized(struct ncplane* \f[R]\f[I]n\f[R]\f[B], const nccell* \f[R]\f[I]ul\f[R]\f[B], const nccell* \f[R]\f[I]ur\f[R]\f[B], const nccell* \f[R]\f[I]ll\f[R]\f[B], const nccell* \f[R]\f[I]lr\f[R]\f[B], const nccell* \f[R]\f[I]hline\f[R]\f[B], const nccell* \f[R]\f[I]vline\f[R]\f[B], int \f[R]\f[I]ylen\f[R]\f[B], int \f[R]\f[I]xlen\f[R]\f[B], unsigned \f[R]\f[I]ctlword\f[R]\f[B]);\f[R] .PP \f[B]static inline int ncplane_perimeter(struct ncplane* \f[R]\f[I]n\f[R]\f[B], const nccell* \f[R]\f[I]ul\f[R]\f[B], const nccell* \f[R]\f[I]ur\f[R]\f[B], const nccell* \f[R]\f[I]ll\f[R]\f[B], const nccell* \f[R]\f[I]lr\f[R]\f[B], const nccell* \f[R]\f[I]hline\f[R]\f[B], const nccell* \f[R]\f[I]vline\f[R]\f[B], unsigned \f[R]\f[I]ctlword\f[R]\f[B])\f[R] .PP \f[B]static inline int nccells_load_box(struct ncplane* \f[R]\f[I]n\f[R]\f[B], uint16_t \f[R]\f[I]styles\f[R]\f[B], uint64_t \f[R]\f[I]channels\f[R]\f[B], nccell* \f[R]\f[I]ul\f[R]\f[B], nccell* \f[R]\f[I]ur\f[R]\f[B], nccell* \f[R]\f[I]ll\f[R]\f[B], nccell* \f[R]\f[I]lr\f[R]\f[B], nccell* \f[R]\f[I]hl\f[R]\f[B], nccell* \f[R]\f[I]vl\f[R]\f[B], const char* \f[R]\f[I]gclusters\f[R]\f[B]);\f[R] .PP \f[B]static inline int nccells_rounded_box(struct ncplane* \f[R]\f[I]n\f[R]\f[B], uint16_t \f[R]\f[I]styles\f[R]\f[B], uint64_t \f[R]\f[I]channels\f[R]\f[B], nccell* \f[R]\f[I]ul\f[R]\f[B], nccell* \f[R]\f[I]ur\f[R]\f[B], nccell* \f[R]\f[I]ll\f[R]\f[B], nccell* \f[R]\f[I]lr\f[R]\f[B], nccell* \f[R]\f[I]hl\f[R]\f[B], nccell* \f[R]\f[I]vl\f[R]\f[B]);\f[R] .PP \f[B]static inline int ncplane_rounded_box(struct ncplane* \f[R]\f[I]n\f[R]\f[B], uint16_t \f[R]\f[I]styles\f[R]\f[B], uint64_t \f[R]\f[I]channels\f[R]\f[B], int \f[R]\f[I]ystop\f[R]\f[B], int \f[R]\f[I]xstop\f[R]\f[B], unsigned \f[R]\f[I]ctlword\f[R]\f[B]);\f[R] .PP \f[B]static inline int ncplane_rounded_box_sized(struct ncplane* \f[R]\f[I]n\f[R]\f[B], uint16_t \f[R]\f[I]styles\f[R]\f[B], uint64_t \f[R]\f[I]channels\f[R]\f[B], int \f[R]\f[I]ylen\f[R]\f[B], int \f[R]\f[I]xlen\f[R]\f[B], unsigned \f[R]\f[I]ctlword\f[R]\f[B]);\f[R] .PP \f[B]static inline int nccells_double_box(struct ncplane* \f[R]\f[I]n\f[R]\f[B], uint16_t \f[R]\f[I]styles\f[R]\f[B], uint64_t \f[R]\f[I]channels\f[R]\f[B], nccell* \f[R]\f[I]ul\f[R]\f[B], nccell* \f[R]\f[I]ur\f[R]\f[B], nccell* \f[R]\f[I]ll\f[R]\f[B], nccell* \f[R]\f[I]lr\f[R]\f[B], nccell* \f[R]\f[I]hl\f[R]\f[B], nccell* \f[R]\f[I]vl\f[R]\f[B]);\f[R] .PP \f[B]static inline int ncplane_double_box(struct ncplane* \f[R]\f[I]n\f[R]\f[B], uint16_t \f[R]\f[I]styles\f[R]\f[B], uint64_t \f[R]\f[I]channels\f[R]\f[B], int \f[R]\f[I]ystop\f[R]\f[B], int \f[R]\f[I]xstop\f[R]\f[B], unsigned \f[R]\f[I]ctlword\f[R]\f[B]);\f[R] .PP \f[B]static inline int ncplane_double_box_sized(struct ncplane* \f[R]\f[I]n\f[R]\f[B], uint16_t \f[R]\f[I]styles\f[R]\f[B], uint64_t \f[R]\f[I]channels\f[R]\f[B], int \f[R]\f[I]ylen\f[R]\f[B], int \f[R]\f[I]xlen\f[R]\f[B], unsigned \f[R]\f[I]ctlword\f[R]\f[B]);\f[R] .PP \f[B]int ncplane_polyfill_yx(struct ncplane* \f[R]\f[I]n\f[R]\f[B], unsigned \f[R]\f[I]y\f[R]\f[B], unsigned \f[R]\f[I]x\f[R]\f[B], const nccell* \f[R]\f[I]c\f[R]\f[B]);\f[R] .PP \f[B]int ncplane_gradient(struct ncplane* \f[R]\f[I]n\f[R]\f[B], int \f[R]\f[I]y\f[R]\f[B], int \f[R]\f[I]x\f[R]\f[B], unsigned \f[R]\f[I]ylen\f[R]\f[B], unsigned \f[R]\f[I]xlen\f[R]\f[B], const char* \f[R]\f[I]egc\f[R]\f[B], uint16_t \f[R]\f[I]stylemask\f[R]\f[B], uint64_t \f[R]\f[I]ul\f[R]\f[B], uint64_t \f[R]\f[I]ur\f[R]\f[B], uint64_t \f[R]\f[I]ll\f[R]\f[B], uint64_t \f[R]\f[I]lr\f[R]\f[B]);\f[R] .PP \f[B]int ncplane_highgradient2x1(struct ncplane* \f[R]\f[I]n\f[R]\f[B], int \f[R]\f[I]y\f[R]\f[B], int \f[R]\f[I]x\f[R]\f[B], unsigned \f[R]\f[I]ylen\f[R]\f[B], unsigned \f[R]\f[I]xlen\f[R]\f[B], uint32_t \f[R]\f[I]ul\f[R]\f[B], uint32_t \f[R]\f[I]ur\f[R]\f[B], uint32_t \f[R]\f[I]ll\f[R]\f[B], uint32_t \f[R]\f[I]lr\f[R]\f[B]);\f[R] .PP \f[B]int ncplane_format(struct ncplane* \f[R]\f[I]n\f[R]\f[B], int \f[R]\f[I]y\f[R]\f[B], int \f[R]\f[I]x\f[R]\f[B], unsigned \f[R]\f[I]ylen\f[R]\f[B], unsigned \f[R]\f[I]xlen\f[R]\f[B], uint16_t \f[R]\f[I]stylemask\f[R]\f[B]);\f[R] .PP \f[B]int ncplane_stain(struct ncplane* \f[R]\f[I]n\f[R]\f[B], int \f[R]\f[I]y\f[R]\f[B], int \f[R]\f[I]x\f[R]\f[B], unsigned \f[R]\f[I]ylen\f[R]\f[B], unsigned \f[R]\f[I]xlen\f[R]\f[B], uint64_t \f[R]\f[I]ul\f[R]\f[B], uint64_t \f[R]\f[I]ur\f[R]\f[B], uint64_t \f[R]\f[I]ll\f[R]\f[B], uint64_t \f[R]\f[I]lr\f[R]\f[B]);\f[R] .SH DESCRIPTION .PP \f[B]ncplane_polyfill_yx\f[R] starts at the specified \f[B]\f[BI]y\f[B]\f[R] and \f[B]\f[BI]x\f[B]\f[R] (provide -1 to use the cursor\[aq]s position in the relevant dimension). The cell at these coordinates is replaced with \f[B]\f[BI]c\f[B]\f[R]. All connected cells having the same content as this original cell are replaced with \f[B]\f[BI]c\f[B]\f[R], recursively. Two cells are connected if they are vertical or horizontal neighbors of one another. .PP \f[B]ncplane_gradient\f[R] replaces all glyphs in the specified area with \f[B]\f[BI]egc\f[B]\f[R], and colors them with the specified gradient. All content within the specified area is destroyed. .PP \f[B]ncplane_gradient2x1\f[R] draws a high-definition gradient in the specified area. It will return an error if UTF8 is not being used. The gradient is drawn using the UPPER HALF BLOCK glyph, 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. .PP \f[B]ncplane_format\f[R] sets the attributes of every cell in the region having its upper-left corner at \f[B]\f[BI]y\f[B]\f[R] and \f[B]\f[BI]x\f[B]\f[R] (provide -1 to use the cursor\[aq]s position in the relevant dimension), and its area defined by \f[B]\f[BI]ylen\f[B]\f[R] and \f[B]\f[BI]xlen\f[B]\f[R] (provide 0 to use all remaining area to the right and below, respectively). Channels and glyphs will be unaffected. .PP \f[B]ncplane_stain\f[R] works the same way, but sets channels. Standard linear interpolation is applied between the provided corner channels. Glyphs and their attributes will be unaffected. .PP Box- and line-drawing is unaffected by a plane\[aq]s scrolling status. .SH RETURN VALUES .PP \f[B]ncplane_format\f[R], \f[B]ncplane_stain\f[R], \f[B]ncplane_gradient\f[R], \f[B]ncplane_gradient2x1\f[R], and \f[B]ncplane_polyfill_yx\f[R] return -1 if any coordinates are outside the plane, and otherwise the number of cells affected. .PP \f[B]ncplane_hline_interp\f[R], \f[B]ncplane_hline\f[R], \f[B]ncplane_vline_interp\f[R], and \f[B]ncplane_vline\f[R] all return the number of glyphs drawn on success, or -1 on failure. Passing a length of 0 is an error. .SH SEE ALSO .PP \f[B]notcurses(3)\f[R], \f[B]notcurses_cell(3)\f[R], \f[B]notcurses_plane(3)\f[R] .SH AUTHORS nick black .