2020-01-02 02:23:11 +00:00
|
|
|
% notcurses_channels(3)
|
|
|
|
% nick black <nickblack@linux.com>
|
2021-12-12 20:11:17 +00:00
|
|
|
% v3.0.1
|
2020-01-02 02:23:11 +00:00
|
|
|
|
|
|
|
# NAME
|
|
|
|
|
2020-01-04 07:37:55 +00:00
|
|
|
notcurses_channels - operations on notcurses channels
|
2020-01-02 02:23:11 +00:00
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
2020-04-19 22:46:32 +00:00
|
|
|
**#include <notcurses/notcurses.h>**
|
2020-01-02 02:23:11 +00:00
|
|
|
|
2020-08-24 19:15:27 +00:00
|
|
|
```c
|
2021-08-13 18:14:33 +00:00
|
|
|
#define NCCHANNEL_INITIALIZER(r, g, b) \
|
2021-07-10 22:34:00 +00:00
|
|
|
(((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + NC_BGDEFAULT_MASK)
|
2021-08-13 18:14:33 +00:00
|
|
|
|
|
|
|
#define NCCHANNELS_INITIALIZER(fr, fg, fb, br, bg, bb) \
|
|
|
|
((NCCHANNEL_INITIALIZER(fr, fg, fb) << 32ull) + \
|
|
|
|
(NCCHANNEL_INITIALIZER(br, bg, bb)))
|
2020-08-24 19:15:27 +00:00
|
|
|
```
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-27 18:10:41 +00:00
|
|
|
**uint32_t ncchannel_r(uint32_t ***channel***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-27 18:10:41 +00:00
|
|
|
**uint32_t ncchannel_g(uint32_t ***channel***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-27 18:10:41 +00:00
|
|
|
**uint32_t ncchannel_b(uint32_t ***channel***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-27 18:10:41 +00:00
|
|
|
**uint32_t ncchannel_rgb8(uint32_t ***channel***, uint32_t* restrict ***r***, uint32_t* restrict ***g***, uint32_t* restrict ***b***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-08-13 07:54:06 +00:00
|
|
|
**int ncchannel_set_rgb8(uint32_t* ***channel***, unsigned ***r***, unsigned ***g***, unsigned ***b***);**
|
2021-01-03 02:23:38 +00:00
|
|
|
|
2021-04-27 18:10:41 +00:00
|
|
|
**int ncchannel_set(uint32_t* ***channel***, uint32_t ***rgb***);**
|
2021-02-03 01:34:39 +00:00
|
|
|
|
2021-04-27 18:10:41 +00:00
|
|
|
**uint32_t ncchannel_alpha(uint32_t ***channel***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-27 18:10:41 +00:00
|
|
|
**int ncchannel_set_alpha(uint32_t* ***channel***, unsigned ***alpha***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-27 18:10:41 +00:00
|
|
|
**bool ncchannel_default_p(uint32_t ***channel***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-27 18:10:41 +00:00
|
|
|
**uint32_t ncchannel_set_default(uint32_t* ***channel***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-08-13 07:54:06 +00:00
|
|
|
**uint32_t ncchannels_fg_rgb(uint64_t ***channels***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-08-13 07:54:06 +00:00
|
|
|
**uint32_t ncchannels_bg_rgb(uint64_t ***channels***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-08-13 07:54:06 +00:00
|
|
|
**int ncchannels_set_fg_rgb(uint64_t* ***channels***, uint32_t ***rgb***);**
|
2021-02-03 01:34:39 +00:00
|
|
|
|
2021-08-13 07:54:06 +00:00
|
|
|
**int ncchannels_set_bg_rgb(uint64_t* ***channels***, uint32_t ***rgb***);**
|
2021-02-03 01:34:39 +00:00
|
|
|
|
2021-04-29 05:18:37 +00:00
|
|
|
**unsigned ncchannels_fg_alpha(uint64_t ***channels***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-29 05:18:37 +00:00
|
|
|
**unsigned ncchannels_bg_alpha(uint64_t ***channels***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-29 05:18:37 +00:00
|
|
|
**int ncchannels_set_fg_alpha(uint64_t* ***channels***, int ***alpha***);**
|
2021-02-03 01:34:39 +00:00
|
|
|
|
2021-04-29 05:18:37 +00:00
|
|
|
**int ncchannels_set_bg_alpha(uint64_t* ***channels***, int ***alpha***);**
|
2021-02-03 01:34:39 +00:00
|
|
|
|
2021-08-13 07:54:06 +00:00
|
|
|
**uint32_t ncchannels_fg_rgb8(uint64_t ***channels***, unsigned* ***r***, unsigned* ***g***, unsigned* ***b***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-08-13 07:54:06 +00:00
|
|
|
**uint32_t ncchannels_bg_rgb8(uint64_t ***channels***, unsigned* ***r***, unsigned* ***g***, unsigned* ***b***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-07-25 13:26:40 +00:00
|
|
|
**int ncchannels_set_fg_rgb8(uint64_t* ***channels***, unsigned ***r***, unsigned ***g***, unsigned ***b***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-07-25 13:26:40 +00:00
|
|
|
**int ncchannels_set_bg_rgb8(uint64_t* ***channels***, unsigned ***r***, unsigned ***g***, unsigned ***b***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-29 05:18:37 +00:00
|
|
|
**bool ncchannels_fg_default_p(uint64_t ***channels***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-29 05:18:37 +00:00
|
|
|
**bool ncchannels_bg_default_p(uint64_t ***channels***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-04-29 05:18:37 +00:00
|
|
|
**uint64_t ncchannels_set_fg_default(uint64_t* ***channels***);**
|
2020-08-24 19:15:27 +00:00
|
|
|
|
2021-04-29 05:18:37 +00:00
|
|
|
**uint64_t ncchannels_set_bg_default(uint64_t* ***channels***);**
|
2020-01-04 07:37:55 +00:00
|
|
|
|
2021-07-07 13:36:31 +00:00
|
|
|
**uint64_t ncchannels_reverse(uint64_t ***channels***);**
|
|
|
|
|
2021-11-19 13:50:35 +00:00
|
|
|
**unsigned ncchannel_palindex(uint32_t ***channel***);**
|
|
|
|
|
|
|
|
**bool ncchannel_palindex_p(uint32_t ***channel***);**
|
|
|
|
|
|
|
|
**int ncchannel_set_palindex(uint32_t* ***channel***, int ***idx***);**
|
|
|
|
|
|
|
|
**unsigned ncchannels_fg_palindex(uint64_t ***channels***);**
|
|
|
|
|
|
|
|
**unsigned ncchannels_bg_palindex(uint64_t ***channels***);**
|
|
|
|
|
|
|
|
**int ncchannels_set_fg_palindex(uint64_t* ***channels***, int ***idx***);**
|
|
|
|
|
|
|
|
**int ncchannels_set_bg_palindex(uint64_t* ***channels***, int ***idx***);**
|
|
|
|
|
|
|
|
**uint64_t ncchannels_combine(uint32_t ***fchan***, uint32_t ***bchan***);**
|
|
|
|
|
2020-01-02 02:23:11 +00:00
|
|
|
# DESCRIPTION
|
|
|
|
|
2021-11-19 13:50:35 +00:00
|
|
|
**ncchannel_palindex** extracts the palette index from a channel. The channel
|
|
|
|
must be palette-indexed, or the return value is meaningless. Verify palette
|
|
|
|
indexing with **ncchannel_palindex_p**. A channel can be set to palette
|
|
|
|
indexed mode (and have the index set) with **ncchannel_set_palindex**. The
|
|
|
|
index must be less than **NCPALETTESIZE**.
|
|
|
|
|
|
|
|
**ncchannels_combine** creates a new channel pair using ***fchan*** as the
|
|
|
|
foreground channel and ***bchan*** as the background channel.
|
2020-01-02 02:23:11 +00:00
|
|
|
|
|
|
|
# RETURN VALUES
|
|
|
|
|
2021-12-09 23:33:13 +00:00
|
|
|
Functions returning **int** return -1 on failure, or 0 on success. Failure is
|
|
|
|
always due to invalid inputs. Functions returning **bool** are predicates, and
|
|
|
|
return the requested value. Functions returning **unsigned** forms return the
|
2020-01-04 07:37:55 +00:00
|
|
|
input, modified as requested.
|
|
|
|
|
2021-07-07 13:36:31 +00:00
|
|
|
**ncchannels_reverse** inverts the color components of the two channels,
|
|
|
|
while holding all other elements constant. It's the Notcurses approximation
|
|
|
|
to reverse video.
|
|
|
|
|
2020-01-02 02:23:11 +00:00
|
|
|
# SEE ALSO
|
|
|
|
|
2020-05-09 00:56:39 +00:00
|
|
|
**notcurses(3)**,
|
|
|
|
**notcurses_cell(3)**,
|
|
|
|
**notcurses_plane(3)**,
|
2020-01-02 02:23:11 +00:00
|
|
|
**notcurses_output(3)**
|