Hi,
If the camera is 256 colours (one byte per pixel), then usually the RGB
values are encoded such that 3 bits correspont to red, 3 bits for green,
and 2 for blue (since blue is needed less for distinguishing faces I think).
So, perhaps bits 0-1 are blue, bits 2-4 are green and bits 5-7 are red.
If the camera is 65536 colours, then it is 2 bytes per pixel, so there are more bits
for red, green and blue. I cannot remember the exact amount, but if you need
more help let me know.
So, if it is a 256 colour camera, then you could get (say) the Red value as follows:
unsigned char red=(pixel & 0xe0)>>5;
(0xe0 is the mask for the 3 MSB, and then you right-shift by 5, to get it in a
range of 0 to 7, where 0 is no red, and 7 is brightest red. So you could then multiply by some factor, to get it into any range that you want, e.g. 0 to 100).
You do a similar thing for green and blue.