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