Revision 2093 branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/io/raster/RasterToImageFilter.java

View differences:

RasterToImageFilter.java
33 33
	 */
34 34
	public void process(int x, int y) {
35 35
		raster.getElemInt(x, y, px);
36
		rgb = alpha | ((px[0] & 0xff) << 16) |
37
				((px[1] & 0xff) << 8) | (px[2] & 0xff);
36
		rgb = 	(alpha & ((px[3] & 0xff) << 24)) |
37
				((px[0] & 0xff) << 16) |
38
				((px[1] & 0xff) << 8) | 
39
				(px[2] & 0xff);
38 40
		
39 41
		image.setRGB(x, y, rgb);
40 42
	}
......
52 54
	public void processLine(int y) {
53 55
		for (int x=0; x<width; x++) {
54 56
			int [][] line = raster.getLineInt(y);
55
			rgb = alpha | ((line[x][0] & 0xff) << 16) |
56
				((line[x][1] & 0xff) << 8) | (line[x][2] & 0xff);
57
			rgb = 	(alpha & ((px[3] & 0xff) << 24)) |
58
					((line[x][0] & 0xff) << 16) |
59
					((line[x][1] & 0xff) << 8) | 
60
					(line[x][2] & 0xff);
57 61
	
58 62
				image.setRGB(x, y, rgb);
59 63
		}

Also available in: Unified diff