I'm trying to understand packing of color bytes for ARGB_8888 format.
The documentation states that packing should be done using this formula:
int color = (A & 0xff) << 24 | (B & 0xff) << 16 | (G & 0xff) << 8 | (R & 0xff);
But shouldn't it be instead:
int color = (A & 0xff) << 24 | (R & 0xff) << 16 | (G & 0xff) << 8 | (B & 0xff);
When I unpack a sample pixel from a ARGB_8888 color encoded bitmap that has all red pixels, I'm using:
final int r = (p >> 16) & 0xff;
final int g = (p >> 8) & 0xff;
final int b = p & 0xff;
Which indeed returns me correct values for every color.
My point is, is it the documentation wrong or I'm missing something?