for (int y = 0; y < getHeight(); y++) {
for (int x = 0; x < getWidth(); x++) {
int index = x*y + x;
Color c = getColorAt(x, y);
pixO[index] = c;
}
}int x = index % getWidth(); int y = index / getWidth();
for (int y = 0; y < getHeight(); y++) {
for (int x = 0; x < getWidth(); x++) {
int index = x*y + x;
Color c = getColorAt(x, y);
pixO[index] = c;
}
}int x = index % getWidth(); int y = index / getWidth();