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 CHANNELS_RGB_INITIALIZER(fr, fg, fb, br, bg, bb) \
12 (((((uint64_t)(fr) << 16u) + ((uint64_t)(fg) << 8u) + (uint64_t)(fb)) << 32ull) + \
13 (((br) << 16u) + ((bg) << 8u) + (bb)) + CELL_BGDEFAULT_MASK + CELL_FGDEFAULT_MASK)
14
15 #define CHANNEL_RGB_INITIALIZER(r, g, b) \
16 (((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + CELL_BGDEFAULT_MASK)
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, int r, int g, int b);
28
29 int ncchannel_set(uint32_t* channel, uint32_t rgb);
30
31 unsigned ncchannel_palindex(uint32_t channel);
32
33 int ncchannel_set_palindex(uint32_t* channel, int idx);
34
35 uint32_t ncchannel_alpha(uint32_t channel);
36
37 int ncchannel_set_alpha(uint32_t* channel, unsigned alpha);
38
39 bool ncchannel_default_p(uint32_t channel);
40
41 uint32_t ncchannel_set_default(uint32_t* channel);
42
43 unsigned ncchannels_fg_rgb(uint64_t channels);
44
45 unsigned ncchannels_bg_rgb(uint64_t channels);
46
47 int ncchannels_set_fg_rgb(uint64_t* channels, unsigned rgb);
48
49 int ncchannels_set_bg_rgb(uint64_t* channels, unsigned rgb);
50
51 unsigned ncchannels_fg_alpha(uint64_t channels);
52
53 unsigned ncchannels_bg_alpha(uint64_t channels);
54
55 int ncchannels_set_fg_alpha(uint64_t* channels, int alpha);
56
57 int ncchannels_set_bg_alpha(uint64_t* channels, int alpha);
58
59 unsigned ncchannels_fg_palindex(uint64_t channels);
60
61 unsigned ncchannels_bg_palindex(uint64_t channels);
62
63 int ncchannels_set_fg_palindex(uint64_t* channels, int idx);
64
65 int ncchannels_set_bg_palindex(uint64_t* channels, int idx);
66
67 unsigned ncchannels_fg_rgb8(uint64_t channels, unsigned* r, unsigned*
68 g, unsigned* b);
69
70 unsigned ncchannels_bg_rgb8(uint64_t channels, unsigned* r, unsigned*
71 g, unsigned* b);
72
73 int ncchannels_set_fg_rgb8(uint64_t* channels, int r, int g, int b);
74
75 int ncchannels_set_bg_rgb8(uint64_t* channels, int r, int g, int b);
76
77 bool ncchannels_fg_default_p(uint64_t channels);
78
79 bool ncchannels_bg_default_p(uint64_t channels);
80
81 uint64_t ncchannels_set_fg_default(uint64_t* channels);
82
83 uint64_t ncchannels_set_bg_default(uint64_t* channels);
84
87 Functions returning int return -1 on failure, or 0 on success. Failure
88 is always due to invalid inputs. Functions returning bool are predi‐
89 cates, and return the requested value. Functions returning unsigned
90 forms return the input, modified as requested.
91
93 notcurses(3), notcurses_cell(3), notcurses_plane(3), notcurses_out‐
94 put(3)
95
97 nick black <nickblack@linux.com>.
98
99
100
101 v2.3.1 notcurses_channels(3)