I have to extract the RGBA values from each byte accordingly.
Assuming two bytes B1 and B2 side by side, assuming the following pattern
Code: Select all
A R R R R R G G G G G B B B B B
A: B1 & 0b10000000
R: B1 & 0b01111100
G: B1 & 0b00000011 | B2 & 0b11100000
B: B2 & 0b00011111
Or basically
R = B1 & 0x7C
G = B1 & 0x03 | B2 & 0xE0
B = B2 & 0x1F
But then how should I be shifting the bits to get the correct value?
Here is an example of a 640x480 image encoded in ARGB1555

