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/LinearStretchEnhancementFloatFilter.java
LinearStretchEnhancementFloatFilter.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 LinearStretchEnhancementFloatFilter 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 |
float p = raster.getElemFloat(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 |
float p = raster.getElemFloat(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 |
|
... | ... | |
80 | 72 |
} |
81 | 73 |
} |
82 | 74 |
|
83 |
/* |
|
84 |
* (non-Javadoc) |
|
85 |
* @see org.gvsig.raster.grid.filter.enhancement.LinearEnhancementFilter#getInRasterDataType() |
|
86 |
*/ |
|
87 | 75 |
public int getInRasterDataType() { |
88 | 76 |
return Buffer.TYPE_FLOAT; |
89 | 77 |
} |
Also available in: Unified diff