notcurses/doc/man/man3/notcurses_channels.3.md

100 lines
2.8 KiB
Markdown
Raw Normal View History

2020-01-02 02:23:11 +00:00
% notcurses_channels(3)
% nick black <nickblack@linux.com>
2020-10-10 00:07:01 +00:00
% v1.7.6
2020-01-02 02:23:11 +00:00
# NAME
notcurses_channels - operations on notcurses channels
2020-01-02 02:23:11 +00:00
# SYNOPSIS
**#include <notcurses/notcurses.h>**
2020-01-02 02:23:11 +00:00
2020-08-24 19:15:27 +00:00
```c
#define CHANNELS_RGB_INITIALIZER(fr, fg, fb, br, bg, bb) \
(((((uint64_t)(fr) << 16u) + ((uint64_t)(fg) << 8u) + (uint64_t)(fb)) << 32ull) + \
(((br) << 16u) + ((bg) << 8u) + (bb)) + CELL_BGDEFAULT_MASK + CELL_FGDEFAULT_MASK)
2020-08-24 19:15:27 +00:00
#define CHANNEL_RGB_INITIALIZER(r, g, b) \
(((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + CELL_BGDEFAULT_MASK)
```
2020-08-24 19:15:27 +00:00
**unsigned channel_r(unsigned channel);**
2020-08-24 19:15:27 +00:00
**unsigned channel_g(unsigned channel);**
2020-08-24 19:15:27 +00:00
**unsigned channel_b(unsigned channel);**
**unsigned channel_rgb8(unsigned channel, unsigned* restrict r, unsigned* restrict g, unsigned* restrict b);**
**int channel_set_rgb8(unsigned* channel, int r, int g, int b);**
2020-08-24 19:15:27 +00:00
**int channel_set(unsigned* channel, unsigned rgb);**
2020-08-24 19:15:27 +00:00
**unsigned channel_alpha(unsigned channel);**
2020-08-24 19:15:27 +00:00
**int channel_set_alpha(unsigned* channel, int alpha);**
2020-08-24 19:15:27 +00:00
**bool channel_default_p(unsigned channel);**
2020-08-24 19:15:27 +00:00
**unsigned channel_set_default(unsigned* channel);**
2020-08-24 19:15:27 +00:00
**unsigned channels_bchannel(uint64_t channels);**
2020-08-24 19:15:27 +00:00
**unsigned channels_fchannel(uint64_t channels);**
2020-08-24 19:15:27 +00:00
**uint64_t channels_set_bchannel(uint64_t* channels, uint32_t channel);**
2020-08-24 19:15:27 +00:00
**uint64_t channels_set_fchannel(uint64_t* channels, uint32_t channel);**
**unsigned channels_fg_rgb(uint64_t channels);**
**unsigned channels_bg_rgb(uint64_t channels);**
2020-08-24 19:15:27 +00:00
**unsigned channels_fg_alpha(uint64_t channels);**
2020-08-24 19:15:27 +00:00
**unsigned channels_bg_alpha(uint64_t channels);**
**unsigned channels_fg_rgb8(uint64_t channels, unsigned* r, unsigned* g, unsigned* b);**
**unsigned channels_bg_rgb8(uint64_t channels, unsigned* r, unsigned* g, unsigned* b);**
**int channels_set_fg_rgb8(uint64_t* channels, int r, int g, int b);**
**int channels_set_bg_rgb8(uint64_t* channels, int r, int g, int b);**
**int channels_set_fg_rgb(uint64_t* channels, unsigned rgb);**
**int channels_set_bg_rgb(uint64_t* channels, unsigned rgb);**
2020-08-24 19:15:27 +00:00
**int channels_set_fg_alpha(uint64_t* channels, int alpha);**
2020-08-24 19:15:27 +00:00
**int channels_set_bg_alpha(uint64_t* channels, int alpha);**
2020-08-24 19:15:27 +00:00
**bool channels_fg_default_p(uint64_t channels);**
2020-08-24 19:15:27 +00:00
**bool channels_bg_default_p(uint64_t channels);**
2020-08-24 19:15:27 +00:00
**uint64_t channels_set_fg_default(uint64_t* channels);**
**uint64_t channels_set_bg_default(uint64_t* channels);**
**unsigned channels_blend(unsigned c1, unsigned c2, unsigned blends);**
2020-01-02 02:23:11 +00:00
# DESCRIPTION
# RETURN VALUES
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
input, modified as requested.
2020-01-02 02:23:11 +00:00
# SEE ALSO
**notcurses(3)**,
**notcurses_cell(3)**,
**notcurses_plane(3)**,
2020-01-02 02:23:11 +00:00
**notcurses_output(3)**