changes: generated annotated code but it still causes type errors + re-formatting...
[IRC.git] / Robust / src / Benchmarks / SSJava / EyeTrackingInfer / Image.java
1
2 public class Image {
3
4   int width;
5
6   int height;
7
8   int pixel[][];
9
10   public Image(int width, int height) {
11     this.width = width;
12     this.height = height;
13     pixel = new int[width][height];
14   }
15
16   public void setPixel(int x, int y, int R, int G, int B) {
17     pixel[x][y] = (R << 16) | (G << 8) | B;
18   }
19
20   public int getRed(int x, int y) {
21     return (pixel[x][y] >> 16) & 0xff;
22   }
23
24   public int getGreen(int x, int y) {
25     return (pixel[x][y] >> 8) & 0xff;
26   }
27
28   public int getBlue(int x, int y) {
29     return pixel[x][y] & 0xff;
30   }
31
32   public void setPixel(int x, int y, int p) {
33     pixel[x][y] = p;
34   }
35
36   public long getPixel(int x, int y) {
37     return pixel[x][y];
38   }
39
40   public int getWidth() {
41     return width;
42   }
43
44   public int getHeight() {
45     return height;
46   }
47
48 }