c - Explore the memory with only a void pointer -


I am starting with a C language (I usually work with Java or PHP), and I have zero Problem with * indicator type.

In my program, I get a pixel buffer from an external API containing the structure f . (Zero *) F -> Pickbox

This indicator indicates pixel buffer encoded in BGR 24. 3 bytes match a pixel (1 byte per color).

I want to keep only 1 octet pixel (pixels = 3 bytes). But I do not know how to do it. Do I have all these octets address (F -> pixfab), is it possible to fill each octet one by one and one tab one by one?

PS: Size of F -> Pixelbuff 5 292 000 bytes

Need something by the way:

  int length = f-> pixbuflen; Unsigned four * sourcepixel = (unsigned char *) F- & gt; Pixbuf; Unsigned char * destpixels = malloc (length / 3); // Number of RGB pixels of the original image for length (int i = 0; i  

This is a non-optimized, non-trial, non-error checking code.


Comments