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

View differences:

LinearEnhancementImageFilter.java
19 19
		//Obtenci?n de par?metros
20 20
		this.image = (Image)params.get("raster");
21 21
		this.stats = (RasterStats)params.get("stats");
22
		this.removeExtrema = ((Boolean)params.get("remove")).booleanValue();
22 23
		height = image.getHeight(null);
23 24
		width = image.getWidth(null);
24 25
		super.pre();
......
31 32
			((pt & 0xff00) >> 8) & 0xff, pt & 0xff};
32 33
			
33 34
		for (int i=0; i<3; i++) {
34
			if (px4[i+1] > stats.maxBandValue[i])
35
				px4[i+1] = stats.maxBandValue[i];
36
			else if (px4[i+1] < stats.minBandValue[i] )
37
					px4[i+1] = stats.minBandValue[i];
35
			if (px4[i+1] > maxBandValue[i])
36
				px4[i+1] = maxBandValue[i];
37
			else if (px4[i+1] < minBandValue[i] )
38
					px4[i+1] = minBandValue[i];
38 39
			px4[i+1] = (((int) (((double)px4[i+1])*scale[i] + offset[i])) & 0xff);
39 40
		}
40 41
		((BufferedImage) image).setRGB(x,y, (

Also available in: Unified diff