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