mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
rename _rgb_clipped functions rgb8_clipped
This commit is contained in:
parent
4459efa216
commit
607c03edc4
4
NEWS.md
4
NEWS.md
@ -1,6 +1,10 @@
|
||||
This document attempts to list user-visible changes and any major internal
|
||||
rearrangements of Notcurses.
|
||||
|
||||
* 1.7.4 (not yet released)
|
||||
* All `_rgb_clipped()` functions have been renamed `_rgb8_clipped()`, to
|
||||
match the changes made in 1.7.2. Sorry, I ought have done this before.
|
||||
|
||||
* 1.7.3 (2020-09-19)
|
||||
* API changes pursuant to 2.0 API finalization:
|
||||
* `mbswidth()` has been renamed `ncstrwidth()`.
|
||||
|
12
USAGE.md
12
USAGE.md
@ -1453,8 +1453,8 @@ int ncplane_set_fg_rgb8(struct ncplane* n, int r, int g, int b);
|
||||
int ncplane_set_bg_rgb8(struct ncplane* n, int r, int g, int b);
|
||||
|
||||
// Same, but clipped to [0..255].
|
||||
void ncplane_set_bg_rgb_clipped(struct ncplane* n, int r, int g, int b);
|
||||
void ncplane_set_fg_rgb_clipped(struct ncplane* n, int r, int g, int b);
|
||||
void ncplane_set_bg_rgb8_clipped(struct ncplane* n, int r, int g, int b);
|
||||
void ncplane_set_fg_rgb8_clipped(struct ncplane* n, int r, int g, int b);
|
||||
|
||||
// Same, but with rgb assembled into a channel (i.e. lower 24 bits).
|
||||
int ncplane_set_fg_rgb(struct ncplane* n, uint32_t channel);
|
||||
@ -1796,8 +1796,8 @@ cell_set_fg_rgb8(cell* cl, int r, int g, int b){
|
||||
|
||||
// Same, but clipped to [0..255].
|
||||
static inline void
|
||||
cell_set_fg_rgb_clipped(cell* cl, int r, int g, int b){
|
||||
channels_set_fg_rgb_clipped(&cl->channels, r, g, b);
|
||||
cell_set_fg_rgb8_clipped(cell* cl, int r, int g, int b){
|
||||
channels_set_fg_rgb8_clipped(&cl->channels, r, g, b);
|
||||
}
|
||||
|
||||
// Same, but with an assembled 24-bit RGB value.
|
||||
@ -1815,8 +1815,8 @@ cell_set_bg_rgb8(cell* cl, int r, int g, int b){
|
||||
|
||||
// Same, but clipped to [0..255].
|
||||
static inline void
|
||||
cell_set_bg_rgb_clipped(cell* cl, int r, int g, int b){
|
||||
channels_set_bg_rgb_clipped(&cl->channels, r, g, b);
|
||||
cell_set_bg_rgb8_clipped(cell* cl, int r, int g, int b){
|
||||
channels_set_bg_rgb8_clipped(&cl->channels, r, g, b);
|
||||
}
|
||||
|
||||
// Same, but with an assembled 24-bit RGB value.
|
||||
|
@ -102,9 +102,9 @@ typedef struct cell {
|
||||
|
||||
**int cell_set_bg_rgb8(cell* cl, int r, int g, int b);**
|
||||
|
||||
**void cell_set_fg_rgb_clipped(cell* cl, int r, int g, int b);**
|
||||
**void cell_set_fg_rgb8_clipped(cell* cl, int r, int g, int b);**
|
||||
|
||||
**void cell_set_bg_rgb_clipped(cell* cl, int r, int g, int b);**
|
||||
**void cell_set_bg_rgb8_clipped(cell* cl, int r, int g, int b);**
|
||||
|
||||
**int cell_set_fg_rgb(cell* c, uint32_t channel);**
|
||||
|
||||
|
@ -110,9 +110,9 @@ notcurses_plane - operations on ncplanes
|
||||
|
||||
**int ncplane_set_bg_rgb8(struct ncplane* n, int r, int g, int b);**
|
||||
|
||||
**void ncplane_set_fg_rgb_clipped(struct ncplane* n, int r, int g, int b);**
|
||||
**void ncplane_set_fg_rgb8_clipped(struct ncplane* n, int r, int g, int b);**
|
||||
|
||||
**void ncplane_set_bg_rgb_clipped(struct ncplane* n, int r, int g, int b);**
|
||||
**void ncplane_set_bg_rgb8_clipped(struct ncplane* n, int r, int g, int b);**
|
||||
|
||||
**int ncplane_set_fg_rgb8(struct ncplane* n, uint32_t channel);**
|
||||
|
||||
|
@ -164,7 +164,7 @@ namespace ncpp
|
||||
bool set_fg_rgb8 (int r, int g, int b, bool clipped = false) noexcept
|
||||
{
|
||||
if (clipped) {
|
||||
cell_set_fg_rgb_clipped (&_cell, r, g, b);
|
||||
cell_set_fg_rgb8_clipped (&_cell, r, g, b);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ namespace ncpp
|
||||
bool set_bg_rgb8 (int r, int g, int b, bool clipped = false) noexcept
|
||||
{
|
||||
if (clipped) {
|
||||
cell_set_bg_rgb_clipped (&_cell, r, g, b);
|
||||
cell_set_bg_rgb8_clipped (&_cell, r, g, b);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -738,7 +738,7 @@ namespace ncpp
|
||||
bool set_fg_rgb8 (int r, int g, int b, bool clipped = false) const NOEXCEPT_MAYBE
|
||||
{
|
||||
if (clipped) {
|
||||
ncplane_set_fg_rgb_clipped (plane, r, g, b);
|
||||
ncplane_set_fg_rgb8_clipped (plane, r, g, b);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -768,7 +768,7 @@ namespace ncpp
|
||||
bool set_bg_rgb8 (int r, int g, int b, bool clipped = false) const NOEXCEPT_MAYBE
|
||||
{
|
||||
if (clipped) {
|
||||
ncplane_set_fg_rgb_clipped (plane, r, g, b);
|
||||
ncplane_set_fg_rgb8_clipped (plane, r, g, b);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ channel_set_rgb8(uint32_t* channel, int r, int g, int b){
|
||||
// the default color. Retain the other bits unchanged. r, g, and b will be
|
||||
// clipped to the range [0..255].
|
||||
static inline void
|
||||
channel_set_rgb_clipped(unsigned* channel, int r, int g, int b){
|
||||
channel_set_rgb8_clipped(unsigned* channel, int r, int g, int b){
|
||||
if(r >= 256){
|
||||
r = 255;
|
||||
}
|
||||
@ -339,9 +339,9 @@ channels_set_fg_rgb8(uint64_t* channels, int r, int g, int b){
|
||||
|
||||
// Same, but clips to [0..255].
|
||||
static inline void
|
||||
channels_set_fg_rgb_clipped(uint64_t* channels, int r, int g, int b){
|
||||
channels_set_fg_rgb8_clipped(uint64_t* channels, int r, int g, int b){
|
||||
unsigned channel = channels_fchannel(*channels);
|
||||
channel_set_rgb_clipped(&channel, r, g, b);
|
||||
channel_set_rgb8_clipped(&channel, r, g, b);
|
||||
*channels = ((uint64_t)channel << 32llu) | (*channels & 0xffffffffllu);
|
||||
}
|
||||
|
||||
@ -394,9 +394,9 @@ channels_set_bg_rgb8(uint64_t* channels, int r, int g, int b){
|
||||
|
||||
// Same, but clips to [0..255].
|
||||
static inline void
|
||||
channels_set_bg_rgb_clipped(uint64_t* channels, int r, int g, int b){
|
||||
channels_set_bg_rgb8_clipped(uint64_t* channels, int r, int g, int b){
|
||||
unsigned channel = channels_bchannel(*channels);
|
||||
channel_set_rgb_clipped(&channel, r, g, b);
|
||||
channel_set_rgb8_clipped(&channel, r, g, b);
|
||||
channels_set_bchannel(channels, channel);
|
||||
}
|
||||
|
||||
@ -1798,8 +1798,8 @@ cell_set_fg_rgb8(cell* cl, int r, int g, int b){
|
||||
|
||||
// Same, but clipped to [0..255].
|
||||
static inline void
|
||||
cell_set_fg_rgb_clipped(cell* cl, int r, int g, int b){
|
||||
channels_set_fg_rgb_clipped(&cl->channels, r, g, b);
|
||||
cell_set_fg_rgb8_clipped(cell* cl, int r, int g, int b){
|
||||
channels_set_fg_rgb8_clipped(&cl->channels, r, g, b);
|
||||
}
|
||||
|
||||
// Same, but with an assembled 24-bit RGB value.
|
||||
@ -1829,8 +1829,8 @@ cell_set_bg_rgb8(cell* cl, int r, int g, int b){
|
||||
|
||||
// Same, but clipped to [0..255].
|
||||
static inline void
|
||||
cell_set_bg_rgb_clipped(cell* cl, int r, int g, int b){
|
||||
channels_set_bg_rgb_clipped(&cl->channels, r, g, b);
|
||||
cell_set_bg_rgb8_clipped(cell* cl, int r, int g, int b){
|
||||
channels_set_bg_rgb8_clipped(&cl->channels, r, g, b);
|
||||
}
|
||||
|
||||
// Same, but with an assembled 24-bit RGB value. A value over 0xffffff
|
||||
@ -1964,8 +1964,8 @@ API int ncplane_set_fg_rgb8(struct ncplane* n, int r, int g, int b);
|
||||
API int ncplane_set_bg_rgb8(struct ncplane* n, int r, int g, int b);
|
||||
|
||||
// Same, but clipped to [0..255].
|
||||
API void ncplane_set_bg_rgb_clipped(struct ncplane* n, int r, int g, int b);
|
||||
API void ncplane_set_fg_rgb_clipped(struct ncplane* n, int r, int g, int b);
|
||||
API void ncplane_set_bg_rgb8_clipped(struct ncplane* n, int r, int g, int b);
|
||||
API void ncplane_set_fg_rgb8_clipped(struct ncplane* n, int r, int g, int b);
|
||||
|
||||
// Same, but with rgb assembled into a channel (i.e. lower 24 bits).
|
||||
API int ncplane_set_fg_rgb(struct ncplane* n, unsigned channel);
|
||||
|
@ -130,8 +130,8 @@ uint16_t ncplane_attr(const struct ncplane* n);
|
||||
unsigned ncplane_styles(const struct ncplane* n);
|
||||
int ncplane_set_fg_rgb8(struct ncplane* n, int r, int g, int b);
|
||||
int ncplane_set_bg_rgb8(struct ncplane* n, int r, int g, int b);
|
||||
void ncplane_set_fg_rgb_clipped(struct ncplane* n, int r, int g, int b);
|
||||
void ncplane_set_bg_rgb_clipped(struct ncplane* n, int r, int g, int b);
|
||||
void ncplane_set_fg_rgb8_clipped(struct ncplane* n, int r, int g, int b);
|
||||
void ncplane_set_bg_rgb8_clipped(struct ncplane* n, int r, int g, int b);
|
||||
int ncplane_set_fg_rgb(struct ncplane* n, unsigned channel);
|
||||
int ncplane_set_bg_rgb(struct ncplane* n, unsigned channel);
|
||||
void ncplane_set_fg_default(struct ncplane* n);
|
||||
|
@ -51,7 +51,7 @@ lighten(struct ncplane* n, cell* c, int distance, int y, int x){
|
||||
r += rand() % (64 / (2 * distance + 1) + 1);
|
||||
g += rand() % (64 / (2 * distance + 1) + 1);
|
||||
b += rand() % (64 / (2 * distance + 1) + 1);
|
||||
cell_set_fg_rgb_clipped(c, r, g, b);
|
||||
cell_set_fg_rgb8_clipped(c, r, g, b);
|
||||
return ncplane_putc_yx(n, y, x, c);
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ make_slider(struct notcurses* nc, int dimy, int dimx){
|
||||
ncplane_set_bg_alpha(n, CELL_ALPHA_TRANSPARENT);
|
||||
for(int x = 0 ; x < REPS ; ++x){
|
||||
for(size_t l = 0 ; l < sizeof(leg) / sizeof(*leg) ; ++l){
|
||||
ncplane_set_fg_rgb_clipped(n, r + 0x8 * l, g + 0x8 * l, b + 0x8 * l);
|
||||
ncplane_set_fg_rgb8_clipped(n, r + 0x8 * l, g + 0x8 * l, b + 0x8 * l);
|
||||
if(ncplane_set_bg_rgb8(n, (l + 1) * 0x2, 0x20, (l + 1) * 0x2)){
|
||||
ncplane_destroy(n);
|
||||
return NULL;
|
||||
|
@ -730,7 +730,7 @@ static inline uint32_t
|
||||
calc_gradient_channel(uint32_t ul, uint32_t ur, uint32_t ll, uint32_t lr,
|
||||
int y, int x, int ylen, int xlen){
|
||||
uint32_t chan = 0;
|
||||
channel_set_rgb_clipped(&chan,
|
||||
channel_set_rgb8_clipped(&chan,
|
||||
calc_gradient_component(channel_r(ul), channel_r(ur),
|
||||
channel_r(ll), channel_r(lr),
|
||||
y, x, ylen, xlen),
|
||||
|
@ -1115,16 +1115,16 @@ void ncplane_set_bg_default(ncplane* n){
|
||||
channels_set_bg_default(&n->channels);
|
||||
}
|
||||
|
||||
void ncplane_set_bg_rgb_clipped(ncplane* n, int r, int g, int b){
|
||||
channels_set_bg_rgb_clipped(&n->channels, r, g, b);
|
||||
void ncplane_set_bg_rgb8_clipped(ncplane* n, int r, int g, int b){
|
||||
channels_set_bg_rgb8_clipped(&n->channels, r, g, b);
|
||||
}
|
||||
|
||||
int ncplane_set_bg_rgb8(ncplane* n, int r, int g, int b){
|
||||
return channels_set_bg_rgb8(&n->channels, r, g, b);
|
||||
}
|
||||
|
||||
void ncplane_set_fg_rgb_clipped(ncplane* n, int r, int g, int b){
|
||||
channels_set_fg_rgb_clipped(&n->channels, r, g, b);
|
||||
void ncplane_set_fg_rgb8_clipped(ncplane* n, int r, int g, int b){
|
||||
channels_set_fg_rgb8_clipped(&n->channels, r, g, b);
|
||||
}
|
||||
|
||||
int ncplane_set_fg_rgb8(ncplane* n, int r, int g, int b){
|
||||
|
Loading…
x
Reference in New Issue
Block a user