void set(int x, int y, int value) { if (x < 0 || y < 0 || x >= width || y >= height) return; data[y * width + x] = value; }