Method that processes pixels in a certain way
in a code snippet, I have found the following method that I could not understand: static void processPixels(int width, int height, int *pixels, int *rgb) { int R[256]; int G[256]; int B[256]; for (int i = 0; i < 256; i++) { R[i] = (rgb[i] << 16) & 0x00FF0000; G[i] = (rgb[i] << 8) & 0x0000FF00; B[i] = rgb[i] & 0x000000FF; } for (int i = 0; i < width * height; i++) { pixels[i] = (0xFF000000 & pixels[i]) | (R[(pixels[i] >> 16) & 0xFF]) | (G[(pixels[i] >> 8) & 0xFF]) | (B[pixels[i] & 0xFF]); } } Can somebody explain what the purpose of those shiftings are ? Are they extracting sth. ? And what is