mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
restore nccell_[bf]channel using safe ncchannels_bchannel #2571
This commit is contained in:
parent
24293e8d72
commit
beea4d62d8
1
NEWS.md
1
NEWS.md
@ -7,6 +7,7 @@ rearrangements of Notcurses.
|
||||
`ncchannels_set_[fb]channel()`, and `ncchannels_[fb]channel()` now
|
||||
function only on the 28 alpha + coloring bits of their respective
|
||||
channels, which is almost certainly what you wanted in the first place.
|
||||
* Restore `nccell_set_[fb]channel()` and friends, using these semantics.
|
||||
|
||||
* 3.0.5 (2022-01-21)
|
||||
* The Hyper and Super modifiers are now supported. CapsLock and NumLock
|
||||
|
6
USAGE.md
6
USAGE.md
@ -2245,13 +2245,15 @@ Helpers are provided to manipulate an `nccell`'s `channels` member. They are
|
||||
all implemented in terms of the lower-level [Channels API](#channels).
|
||||
|
||||
```c
|
||||
// Extract the 32-bit background channel from a cell.
|
||||
// Extract the background alpha and coloring bits from a cell's channels
|
||||
// as a single 32-bit value.
|
||||
static inline uint32_t
|
||||
nccell_bchannel(const nccell* cl){
|
||||
return ncchannels_bchannel(cl->channels);
|
||||
}
|
||||
|
||||
// Extract the 32-bit foreground channel from a cell.
|
||||
// Extract the foreground alpha and coloring bits from a cell's channels
|
||||
// as a single 32-bit value.
|
||||
static inline uint32_t
|
||||
nccell_fchannel(const nccell* cl){
|
||||
return ncchannels_fchannel(cl->channels);
|
||||
|
@ -821,6 +821,20 @@ nccell_wide_left_p(const nccell* c){
|
||||
API __attribute__ ((returns_nonnull)) const char*
|
||||
nccell_extended_gcluster(const struct ncplane* n, const nccell* c);
|
||||
|
||||
// Extract the background alpha and coloring bits from a cell's channels
|
||||
// as a single 32-bit value.
|
||||
static inline uint32_t
|
||||
nccell_bchannel(const nccell* cl){
|
||||
return ncchannels_bchannel(cl->channels);
|
||||
}
|
||||
|
||||
// Extract the foreground alpha and coloring bits from a cell's channels
|
||||
// as a single 32-bit value.
|
||||
static inline uint32_t
|
||||
nccell_fchannel(const nccell* cl){
|
||||
return ncchannels_fchannel(cl->channels);
|
||||
}
|
||||
|
||||
// return the number of columns occupied by 'c'. see ncstrwidth() for an
|
||||
// equivalent for multiple EGCs.
|
||||
static inline unsigned
|
||||
|
Loading…
x
Reference in New Issue
Block a user