logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

notcurses_lines - operations on lines and boxes

Authors

       nick black <nickblack@linux.com>.

                                                     v3.0.7                                   notcurses_lines(3)

Description

ncplane_polyfill_yx starts at the specified y and x (provide -1 to use the cursor's position in the rele‐
       vant  dimension).  The cell at these coordinates is replaced with c.  All connected cells having the same
       content as this original cell are replaced with c, recursively.  Two cells are connected if they are ver‐
       tical or horizontal neighbors of one another.

       ncplane_gradient replaces all glyphs in the specified area with egc, 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 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.

       ncplane_format sets the attributes of every cell in the region having its upper-left corner at  y  and  x
       (provide  -1  to  use  the cursor's position in the relevant dimension), and its area defined by ylen and
       xlen (provide 0 to 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.

Name

       notcurses_lines - operations on lines and boxes

Return Values

ncplane_format, ncplane_stain, ncplane_gradient, ncplane_gradient2x1, and ncplane_polyfill_yx  return  -1
       if any coordinates are outside the plane, and otherwise the number of cells affected.

       ncplane_hline_interp,  ncplane_hline,  ncplane_vline_interp,  and  ncplane_vline all return the number of
       glyphs drawn on success, or -1 on failure.  Passing a length of 0 is an error.

See Also

notcurses(3), notcurses_cell(3), notcurses_plane(3)

Synopsis

#include<notcurses/notcurses.h>intncplane_hline_interp(structncplane*n,constnccell*c,unsignedlen,uint64_tc1,uint64_tc2);staticinlineintncplane_hline(structncplane*n,constnccell*c,unsignedlen);intncplane_vline_interp(structncplane*n,constnccell*c,unsignedlen,uint64_tc1,uint64_tc2);staticinlineintncplane_vline(structncplane*n,constnccell*c,unsignedlen);

              #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

       intncplane_box(structncplane*n,constnccell*ul,constnccell*ur,constnccell*ll,constnccell*lr,constnccell*hline,constnccell*vline,intystop,intxstop,unsignedctlword);staticinlineintncplane_box_sized(structncplane*n,constnccell*ul,constnccell*ur,constnccell*ll,constnccell*lr,constnccell*hline,constnccell*vline,intylen,intxlen,unsignedctlword);staticinlineintncplane_perimeter(structncplane*n,constnccell*ul,constnccell*ur,constnccell*ll,constnccell*lr,constnccell*hline,constnccell*vline,unsignedctlword)staticinlineintnccells_load_box(structncplane*n,uint16_tstyles,uint64_tchannels,nccell*ul,nc‐cell*ur,nccell*ll,nccell*lr,nccell*hl,nccell*vl,constchar*gclusters);staticinlineintnccells_rounded_box(structncplane*n,uint16_tstyles,uint64_tchannels,nccell*ul,nccell*ur,nccell*ll,nccell*lr,nccell*hl,nccell*vl);staticinlineintncplane_rounded_box(structncplane*n,uint16_tstyles,uint64_tchannels,intystop,intxstop,unsignedctlword);staticinlineintncplane_rounded_box_sized(structncplane*n,uint16_tstyles,uint64_tchannels,intylen,intxlen,unsignedctlword);staticinlineintnccells_double_box(structncplane*n,uint16_tstyles,uint64_tchannels,nccell*ul,nccell*ur,nccell*ll,nccell*lr,nccell*hl,nccell*vl);staticinlineintncplane_double_box(structncplane*n,uint16_tstyles,uint64_tchannels,intystop,intxstop,unsignedctlword);staticinlineintncplane_double_box_sized(structncplane*n,uint16_tstyles,uint64_tchannels,intylen,intxlen,unsignedctlword);intncplane_polyfill_yx(structncplane*n,unsignedy,unsignedx,constnccell*c);intncplane_gradient(structncplane*n,inty,intx,unsignedylen,unsignedxlen,constchar*egc,uint16_tstylemask,uint64_tul,uint64_tur,uint64_tll,uint64_tlr);intncplane_highgradient2x1(structncplane*n,inty,intx,unsignedylen,unsignedxlen,uint32_tul,uint32_tur,uint32_tll,uint32_tlr);intncplane_format(structncplane*n,inty,intx,unsignedylen,unsignedxlen,uint16_tstylemask);intncplane_stain(structncplane*n,inty,intx,unsignedylen,unsignedxlen,uint64_tul,uint64_tur,uint64_tll,uint64_tlr);

See Also