Closed dreamos82 closed 4 months ago
There were different issues:
uint32_t
the result was wrong, because char is signed. uint32_t num = (uint32_t) pixel[0] << 24 |
(uint32_t)pixel[1] << 16 |
(uint32_t)pixel[2] << 8 |
(uint32_t)pixel[3];
but:
uint32_t num = ((uint32_t)pixel[3] << 24) |
((uint32_t)pixel[0] << 16) |
((uint32_t)pixel[1] << 8) |
(uint32_t)pixel[2];
and pixel is now unsigned char
Btw the original version was working with a different byte order. I don't know why XD
Apparently there is an issue in rendering colors.
The above screenshot should have contained rainbow colors. But it is definetely wrong! :)