- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreen32.java
More file actions
Latest commit
53 lines (45 loc) · 1.23 KB
/
Copy pathScreen32.java
File metadata and controls
53 lines (45 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
importjava.awt.Image;
importjava.awt.MediaTracker;
importjava.awt.image.*;
/**
* Class for 32-bit image arrays.
* @author Robert Bögniel
*/
publicclassScreen32 {
publicintdata[];
publicintytab[];
publicintwidth, height;
publicinthwidth, hheight;
privateintwidthheight, i;
//Constructor
publicScreen32(intw, inth) {
width = w;
height = h;
widthheight = w*h;
hheight = h>>1;
hwidth = w>>1;
data = newint[widthheight];
ytab = newint[height];
intyval = 0;
for(i = 0; i<height; i++) {
ytab[i] = yval;
yval+=width;
}
}
publicfinalvoidload(Imageim) {
PixelGrabberpg;
pg = newPixelGrabber(im, 0,0, width, height, data, 0, width);
try { pg.grabPixels(); } catch (InterruptedExceptione) {
}
pg = null;
}
publicfinalvoidcopy(Screen32source) {
for(i = this.widthheight; --i >= 0; ) this.data[i] = source.data[i];
}
publicfinalvoidclear(intc) { for(i = this.widthheight; --i >= 0; ) data[i] = c; }
publicfinalintgetwidth() {return(width); }
publicfinalintgetheight() {return(height); }
publicfinalintgetwidthheight() {return(widthheight); }
publicfinalint[] getdata() {return(data);}
};
/* End Screen32 */