notcurses_cell.3: document palindex functions #2360

dankamongmen/windows-tester
nick black 3 years ago
parent 58d95dfb25
commit 926cc77ac5
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -112,6 +112,18 @@ typedef struct nccell {
**bool nccell_bg_default_p(const nccell* ***c***);**
**int nccell_set_fg_palindex(nccell* ***cl***, int ***idx***);**
**int nccell_set_bg_palindex(nccell* ***cl***, int ***idx***);**
**uint32_t nccell_fg_palindex(const nccell* ***cl***);**
**uint32_t nccell_bg_palindex(const nccell* ***cl***);**
**bool nccell_fg_palindex_p(const nccell* ***cl***);**
**bool nccell_bg_palindex_p(const nccell* ***cl***);**
**int ncstrwidth(const char* ***text***)**;
**int ncstrwidth_valid(const char* ***text***, int* ***validbytes***, int* ***validwidth***)**;
@ -147,6 +159,13 @@ string, or -1 if an error is encountered. In either case, the number of valid
bytes and columns, respectively, consumed before error into ***validbytes***
and ***validwidth*** (assuming them to not be **NULL**).
**nccell_fg_palindex** extracts the palette index from a cell's foreground
channel. The channel must be palette-indexed, or the return value is
meaningless. Verify palette indexing with **nccell_fg_palindex_p**. A cell's
foreground channel can be set to palette-indexed mode (and have the index set)
with **nccell_set_fg_palindex**. The index must be less than **NCPALETTESIZE**.
Replace **fg** with **bg** to operate on the background channel.
# RETURN VALUES
**nccell_load** and similar functions return the number of bytes loaded from the

@ -13,7 +13,7 @@ notcurses_palette - operations on notcurses palettes
```c
typedef struct ncpalette {
// We store the RGB values as a regular ol' channel
uint32_t chans[256];
uint32_t chans[NCPALETTESIZE];
} ncpalette;
```

Loading…
Cancel
Save