update new python for CHANNEL_RGB change

This commit is contained in:
nick black 2021-07-10 18:20:44 -04:00
parent 3123911637
commit 603fd770fe
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 5 additions and 5 deletions

View File

@ -11,11 +11,11 @@ notcurses_channels - operations on notcurses channels
**#include <notcurses/notcurses.h>**
```c
#define CHANNELS_RGB_INITIALIZER(fr, fg, fb, br, bg, bb) \
#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)) + CELL_BGDEFAULT_MASK + CELL_FGDEFAULT_MASK)
#define CHANNEL_RGB_INITIALIZER(r, g, b) \
#define CHANNEL_INITIALIZER(r, g, b) \
(((uint32_t)r << 16u) + ((uint32_t)g << 8u) + (b) + CELL_BGDEFAULT_MASK)
```

View File

@ -24,7 +24,7 @@ python_ncchannels_rgb_initializer(PyObject *Py_UNUSED(self), PyObject *args)
GNU_PY_CHECK_BOOL(PyArg_ParseTuple(args, "KKKKKK", &fr, &fg, &fb, &br, &bg, &bb));
unsigned long long ncchannels = CHANNELS_RGB_INITIALIZER(fr, fg, fb, br, bg, bb);
unsigned long long ncchannels = NCCHANNELS_INITIALIZER(fr, fg, fb, br, bg, bb);
return Py_BuildValue("K", ncchannels);
}
@ -36,7 +36,7 @@ python_ncchannel_rgb_initializer(PyObject *Py_UNUSED(self), PyObject *args)
GNU_PY_CHECK_BOOL(PyArg_ParseTuple(args, "kkk", &r, &g, &b));
unsigned long ncchannel = CHANNEL_RGB_INITIALIZER(r, g, b);
unsigned long ncchannel = CHANNEL_INITIALIZER(r, g, b);
return Py_BuildValue("k", ncchannel);
}
@ -611,4 +611,4 @@ PyMethodDef ChannelsFunctions[] = {
{"ncchannels_set_fg_default", (PyCFunction)python_ncchannels_set_fg_default, METH_VARARGS, "Mark the foreground ncchannel as using its default color."},
{"ncchannels_set_bg_default", (PyCFunction)python_ncchannels_set_bg_default, METH_VARARGS, "Mark the background ncchannel as using its default color."},
{NULL, NULL, 0, NULL},
};
};