mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
rewrite NCCHANNELS_INITIALIZER in terms of NCCHANNEL_INITIALIZER
This commit is contained in:
parent
e35c49889d
commit
c33ce4f9dd
@ -11,12 +11,12 @@ notcurses_channels - operations on notcurses channels
|
|||||||
**#include <notcurses/notcurses.h>**
|
**#include <notcurses/notcurses.h>**
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define NCCHANNELS_INITIALIZER(fr, fg, fb, br, bg, bb) \
|
#define NCCHANNEL_INITIALIZER(r, g, b) \
|
||||||
(((((uint64_t)(fr) << 16u) + ((uint64_t)(fg) << 8u) + (uint64_t)(fb)) << 32ull) + \
|
|
||||||
(((br) << 16u) + ((bg) << 8u) + (bb)) + NC_BGDEFAULT_MASK + NC_FGDEFAULT_MASK)
|
|
||||||
|
|
||||||
#define CHANNEL_INITIALIZER(r, g, b) \
|
|
||||||
(((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + NC_BGDEFAULT_MASK)
|
(((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + NC_BGDEFAULT_MASK)
|
||||||
|
|
||||||
|
#define NCCHANNELS_INITIALIZER(fr, fg, fb, br, bg, bb) \
|
||||||
|
((NCCHANNEL_INITIALIZER(fr, fg, fb) << 32ull) + \
|
||||||
|
(NCCHANNEL_INITIALIZER(br, bg, bb)))
|
||||||
```
|
```
|
||||||
|
|
||||||
**uint32_t ncchannel_r(uint32_t ***channel***);**
|
**uint32_t ncchannel_r(uint32_t ***channel***);**
|
||||||
|
@ -140,14 +140,15 @@ API int notcurses_ucs32_to_utf8(const uint32_t* ucs32, unsigned ucs32count,
|
|||||||
// extract these bits to get the foreground alpha mask
|
// extract these bits to get the foreground alpha mask
|
||||||
#define NC_FG_ALPHA_MASK (NC_BG_ALPHA_MASK << 32u)
|
#define NC_FG_ALPHA_MASK (NC_BG_ALPHA_MASK << 32u)
|
||||||
|
|
||||||
// initialize a 64-bit channel pair with specified RGB fg/bg
|
// initialize a 32-bit channel pair with specified RGB
|
||||||
#define NCCHANNELS_INITIALIZER(fr, fg, fb, br, bg, bb) \
|
|
||||||
(((((uint64_t)(fr) << 16u) + ((uint64_t)(fg) << 8u) + (uint64_t)(fb)) << 32ull) + \
|
|
||||||
(((br) << 16u) + ((bg) << 8u) + (bb)) + NC_BGDEFAULT_MASK + NC_FGDEFAULT_MASK)
|
|
||||||
|
|
||||||
#define NCCHANNEL_INITIALIZER(r, g, b) \
|
#define NCCHANNEL_INITIALIZER(r, g, b) \
|
||||||
(((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + NC_BGDEFAULT_MASK)
|
(((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + NC_BGDEFAULT_MASK)
|
||||||
|
|
||||||
|
// initialize a 64-bit channel pair with specified RGB fg/bg
|
||||||
|
#define NCCHANNELS_INITIALIZER(fr, fg, fb, br, bg, bb) \
|
||||||
|
((NCCHANNEL_INITIALIZER(fr, fg, fb) << 32ull) + \
|
||||||
|
(NCCHANNEL_INITIALIZER(br, bg, bb)))
|
||||||
|
|
||||||
// These lowest-level functions manipulate a 64-bit channel encoding directly.
|
// These lowest-level functions manipulate a 64-bit channel encoding directly.
|
||||||
// Users will typically manipulate ncplane and nccell channels through those
|
// Users will typically manipulate ncplane and nccell channels through those
|
||||||
// APIs, rather than calling these explicitly.
|
// APIs, rather than calling these explicitly.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user