Open jrmuizel opened 7 years ago
In 16 bits: x16 must be uint16
R16 = R5 & 0xF800;
G16 = (R5 & 0x7E0) << 5;
B16 = R5 << 11; // Make sure to be uint16_t
In 8 bits: R5 must be uint16
R8 = (R5 >> 11) << 3;
G8 = (R5 & 0x7E0) >> 3;
B8 = (R5 & 0x1F) << 3;
Fast color conversion from R5G5B5 to R8G8B8 pixel format using shifts
R8 = (R5 << 3) | (R5 >> 2) G8 = (R5 << 3) | (R5 >> 2) B8 = (R5 << 3) | (R5 >> 2)
This looks to assign the same value to R8, G8 and B8