Hi
I am looking at some somple code that creates histogram for a color ... I do understand all but one bit here and I suspect it's a bit shifting operation. Can anybody please explain to me what is it ?
Here is the code:
I do understand that it counts number of color in image but why does it need to to this & 0xFF ???
Thank you
I am looking at some somple code that creates histogram for a color ... I do understand all but one bit here and I suspect it's a bit shifting operation. Can anybody please explain to me what is it ?
Here is the code:
Code:
//calculate histogram for blue
//count instances each color
histArray = new double[256];
for(int i = 0; i <width; i++)
for(int y = 0; y <height; j++)
histArray[imageInt[i][j] & 0xFF] ++
I do understand that it counts number of color in image but why does it need to to this & 0xFF ???
Thank you