Scale down to 8 bit here. - vtv-tools - virtual terminal video tools
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit e8dadc39466370c2295e5e7b176d77e823403fa6
(DIR) parent bdc58b615aed3f5ee2384630412f651689284235
(HTM) Author: Troels Henriksen <athas@sigkill.dk>
Date: Mon, 14 Aug 2023 13:47:29 +0200
Scale down to 8 bit here.
Diffstat:
M src/vtv-from-ff.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
---
(DIR) diff --git a/src/vtv-from-ff.c b/src/vtv-from-ff.c
@@ -103,12 +103,12 @@ void render(int nrows, int ncols, const uint16_t *argbs,
uint32_t *fgs, uint32_t *bgs, char *chars) {
for (int i = 0; i < nrows; i++) {
for (int j = 0; j < ncols; j++) {
- uint32_t r0 = argbs[(i*2)*(ncols*4)+j*4+0];
- uint32_t g0 = argbs[(i*2)*(ncols*4)+j*4+1];
- uint32_t b0 = argbs[(i*2)*(ncols*4)+j*4+2];
- uint32_t r1 = argbs[(i*2+1)*(ncols*4)+j*4+0];
- uint32_t g1 = argbs[(i*2+1)*(ncols*4)+j*4+1];
- uint32_t b1 = argbs[(i*2+1)*(ncols*4)+j*4+2];
+ uint32_t r0 = argbs[(i*2)*(ncols*4)+j*4+0]>>8;
+ uint32_t g0 = argbs[(i*2)*(ncols*4)+j*4+1]>>8;
+ uint32_t b0 = argbs[(i*2)*(ncols*4)+j*4+2]>>8;
+ uint32_t r1 = argbs[(i*2+1)*(ncols*4)+j*4+0]>>8;
+ uint32_t g1 = argbs[(i*2+1)*(ncols*4)+j*4+1]>>8;
+ uint32_t b1 = argbs[(i*2+1)*(ncols*4)+j*4+2]>>8;
uint32_t w0 = r0 << 16 | g0 << 8 | b0;
uint32_t w1 = r1 << 16 | g1 << 8 | b1;