1notcurses_channels(3) notcurses_channels(3)
2
3
4
6 notcurses_channels - operations on notcurses channels
7
9 #include <notcurses/notcurses.h>
10
11 #define NCCHANNEL_INITIALIZER(r, g, b) \
12 (((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + NC_BGDEFAULT_MASK)
13
14 #define NCCHANNELS_INITIALIZER(fr, fg, fb, br, bg, bb) \
15 ((NCCHANNEL_INITIALIZER(fr, fg, fb) << 32ull) + \
16 (NCCHANNEL_INITIALIZER(br, bg, bb)))
17
18 uint32_t ncchannel_r(uint32_t channel);
19
20 uint32_t ncchannel_g(uint32_t channel);
21
22 uint32_t ncchannel_b(uint32_t channel);
23
24 uint32_t ncchannel_rgb8(uint32_t channel, uint32_t* restrict r,
25 uint32_t* restrict g, uint32_t* restrict b);
26
27 int ncchannel_set_rgb8(uint32_t* channel, unsigned r, unsigned g, un‐
28 signed b);
29
30 int ncchannel_set(uint32_t* channel, uint32_t rgb);
31
32 unsigned ncchannel_palindex(uint32_t channel);
33
34 int ncchannel_set_palindex(uint32_t* channel, int idx);
35
36 uint32_t ncchannel_alpha(uint32_t channel);
37
38 int ncchannel_set_alpha(uint32_t* channel, unsigned alpha);
39
40 bool ncchannel_default_p(uint32_t channel);
41
42 uint32_t ncchannel_set_default(uint32_t* channel);
43
44 uint32_t ncchannels_fg_rgb(uint64_t channels);
45
46 uint32_t ncchannels_bg_rgb(uint64_t channels);
47
48 int ncchannels_set_fg_rgb(uint64_t* channels, uint32_t rgb);
49
50 int ncchannels_set_bg_rgb(uint64_t* channels, uint32_t rgb);
51
52 unsigned ncchannels_fg_alpha(uint64_t channels);
53
54 unsigned ncchannels_bg_alpha(uint64_t channels);
55
56 int ncchannels_set_fg_alpha(uint64_t* channels, int alpha);
57
58 int ncchannels_set_bg_alpha(uint64_t* channels, int alpha);
59
60 unsigned ncchannels_fg_palindex(uint64_t channels);
61
62 unsigned ncchannels_bg_palindex(uint64_t channels);
63
64 int ncchannels_set_fg_palindex(uint64_t* channels, int idx);
65
66 int ncchannels_set_bg_palindex(uint64_t* channels, int idx);
67
68 uint32_t ncchannels_fg_rgb8(uint64_t channels, unsigned* r, unsigned*
69 g, unsigned* b);
70
71 uint32_t ncchannels_bg_rgb8(uint64_t channels, unsigned* r, unsigned*
72 g, unsigned* b);
73
74 int ncchannels_set_fg_rgb8(uint64_t* channels, unsigned r, unsigned g,
75 unsigned b);
76
77 int ncchannels_set_bg_rgb8(uint64_t* channels, unsigned r, unsigned g,
78 unsigned b);
79
80 bool ncchannels_fg_default_p(uint64_t channels);
81
82 bool ncchannels_bg_default_p(uint64_t channels);
83
84 uint64_t ncchannels_set_fg_default(uint64_t* channels);
85
86 uint64_t ncchannels_set_bg_default(uint64_t* channels);
87
88 uint64_t ncchannels_reverse(uint64_t channels);
89
92 Functions returning int return -1 on failure, or 0 on success. Failure
93 is always due to invalid inputs. Functions returning bool are predi‐
94 cates, and return the requested value. Functions returning unsigned
95 forms return the input, modified as requested.
96
97 ncchannels_reverse inverts the color components of the two channels,
98 while holding all other elements constant. It's the Notcurses approxi‐
99 mation to reverse video.
100
102 notcurses(3), notcurses_cell(3), notcurses_plane(3), notcurses_out‐
103 put(3)
104
106 nick black <nickblack@linux.com>.
107
108
109
110 v2.4.9 notcurses_channels(3)