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/LinearStretchEnhancementByteFilter.java
LinearStretchEnhancementByteFilter.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 LinearStretchEnhancementByteFilter 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; |
|
45 |
} |
|
36 |
for (int iBand = 0; iBand < renderBands.length; iBand++) { |
|
37 |
if(renderBands[iBand] >= 0) { |
|
38 |
int p; |
|
39 |
if (stretchs.rgb) |
|
40 |
p = (int) (raster.getElemByte(line, col, iBand) & 0xff); |
|
41 |
else |
|
42 |
p = (int) raster.getElemByte(line, col, iBand); |
|
46 | 43 |
|
47 |
int p; |
|
48 |
if (stretchs.rgb) |
|
49 |
p = (int) (raster.getElemByte(line, col, iBand) & 0xff); |
|
50 |
else |
|
51 |
p = (int) raster.getElemByte(line, col, iBand); |
|
52 |
|
|
53 |
if (iBand < scaleOffsetList.length) |
|
54 |
processValue(p, scaleOffsetList[iBand], col, line, iBand); |
|
55 |
else |
|
56 |
rasterResult.setElem(line, col, iBand, (byte) p); |
|
44 |
if (iBand < scaleOffsetList.length) |
|
45 |
processValue(p, scaleOffsetList[iBand], col, line, iBand); |
|
46 |
else |
|
47 |
rasterResult.setElem(line, col, iBand, (byte) p); |
|
48 |
} |
|
57 | 49 |
} |
50 |
writeAlphaBand(line, col); |
|
58 | 51 |
} |
59 | 52 |
|
60 | 53 |
/** |
... | ... | |
84 | 77 |
} |
85 | 78 |
} |
86 | 79 |
|
87 |
/* |
|
88 |
* (non-Javadoc) |
|
89 |
* @see org.gvsig.raster.grid.filter.enhancement.LinearEnhancementFilter#getInRasterDataType() |
|
90 |
*/ |
|
91 | 80 |
public int getInRasterDataType() { |
92 | 81 |
return Buffer.TYPE_BYTE; |
93 | 82 |
} |
Also available in: Unified diff