i am reading a 24bpp bitmap , and i need to convert each pixel from RGB24 to ARGB16. i am using this :
#define ARGB16(a, r, g, b) ( ((a) << 15) ...
Why result of
include <stdio.h> int main() { unsigned short int i = 0xff ; unsigned short int j; j= i<<2; ...
So I byte shift a integer into 4 bytes of data.
img[4] = (imagewidth >> 24) & 0xFF; img[5] = (imagewidth >> 16) & 0xFF; img[6] = (imagewidth >> 8) & 0xFF; img[7] = imagewidth ...