restore nccell_[bf]channel using safe ncchannels_bchannel #2571

pull/2576/head
nick black 2 years ago
parent 24293e8d72
commit beea4d62d8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -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

@ -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…
Cancel
Save