I have a buffer defined as:
buf = (unsigned long*)malloc(imageWidth*imageLength*SamplePerPixel);
Where SamplePerPixel is 4 (A,G,B,R; four components defining a pixel, the RGB components and the alpha channel)
Then, this buffer has this structure: A,G,B,R,A,G,B,R,....
Now, i want to store in a supplied buffer, called dest, ONLY this information of the pixel: R,G,B...
Then, Dest will have this structure: G,B,R,G,B,R,G,B,R..
What must i do??