mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
notcurses_cell.3: document palindex functions #2360
This commit is contained in:
parent
58d95dfb25
commit
926cc77ac5
@ -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…
x
Reference in New Issue
Block a user