Revision 2438 org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementDoubleFilter.java

View differences:

LinearStretchEnhancementDoubleFilter.java
28 28
 * Para cada pixel se obtiene en que intervalo se encuentra y se aplica la scala y offset
29 29
 * calculados para ese intervalo.
30 30
 *
31
 * @version 11/05/2007
32 31
 * @author Nacho Brodin (nachobrodin@gmail.com)
33 32
 */
34 33
public class LinearStretchEnhancementDoubleFilter extends LinearStretchEnhancementFilter {
35 34
		
36
	/*
37
	 * (non-Javadoc)
38
	 * @see org.gvsig.raster.grid.filter.enhancement.LinearEnhancementFilter#process(int, int)
39
	 */
40 35
	public void process(int col, int line) {
41
		for (int iBand = 0; iBand < raster.getBandCount(); iBand++) {
42
			if (renderBands[iBand] < 0) {
43
				rasterResult.setElem(line, col, iBand, (byte) 0);
44
				continue;
36
		for (int destinationBand = 0; destinationBand < renderBands.length; destinationBand++) {
37
			if(renderBands[destinationBand] >= 0) {
38
				double p = raster.getElemDouble(line, col, destinationBand);
39
				if (destinationBand < scaleOffsetList.length)
40
					processValue(p, scaleOffsetList[destinationBand], col, line, destinationBand);
41
				else
42
					rasterResult.setElem(line, col, destinationBand, (byte) p);
45 43
			}
46

  
47
			double p = raster.getElemDouble(line, col, iBand);
48
			if (iBand < scaleOffsetList.length)
49
				processValue(p, scaleOffsetList[iBand], col, line, iBand);
50
			else
51
				rasterResult.setElem(line, col, iBand, (byte) p);
52 44
		}
53 45
	}
54 46

  
......
79 71
		}
80 72
	}
81 73
	
82
	/*
83
	 * (non-Javadoc)
84
	 * @see org.gvsig.raster.grid.filter.enhancement.LinearEnhancementFilter#getInRasterDataType()
85
	 */
86 74
	public int getInRasterDataType() {
87 75
		return Buffer.TYPE_DOUBLE;
88 76
	}

Also available in: Unified diff