shift « byte « C Data Type Q&A

Home
C Data Type Q&A
1.binary
2.bit
3.byte
4.char
5.character
6.decimal
7.Development
8.float
9.hex
10.integer
11.prime
12.random
13.struct
C Data Type Q&A » byte » shift 

1. convert 24bit RGB to ARGB16    stackoverflow.com

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) ...

2. C bits shifting short ints    stackoverflow.com

Why result of

include <stdio.h>
int main()
{
    unsigned short int i = 0xff ;
    unsigned short int j;
    j= i<<2;
    ...

3. After byte shifitng a int to 4 bytes, how can I shift back to int (C)    stackoverflow.com

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 ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.