how to loop over the pixels using 2D array?
问题 For example: loadPixels(); for (int i = 0; i < 240; i++) { for(int j =0; i < 240; j++) { color p = pixels[i][j]; // ERROR : The type of the expression must be an array type but it resolved to int float cRed = 0.2989 * red(p); float cGreen = 0.5870 * green(p); float cBlue = 0.1140 * blue(p); pixels[i][j] = color(cRed, cGreen, cBlue); } } updatePixels(); 回答1: According to the pixels documentation, pixels is a one dimensional array. So you'll probably need to do something like int row = i; int