Revision 2308 org.gvsig.raster/branches/org.gvsig.raster_dataaccess_refactoring/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeByteFilter.java

View differences:

FirstDerivativeByteFilter.java
30 30
 * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
31 31
 */
32 32
public class FirstDerivativeByteFilter extends FirstDerivativeFilter {
33
	/*
34
	 * (non-Javadoc)
35
	 * @see org.gvsig.raster.grid.filter.RasterFilter#process(int, int)
36
	 */
37 33
	public void process(int col, int line) {
38 34
		int out;
39 35
		int convoResult[] = new int[4];
......
44 40

  
45 41
		Kernel kernel = null;
46 42

  
47
		for (int band = 0; band < raster.getBandCount(); band++) {
43
		for (int band = 0; band < nBandsToProcess; band++) {
48 44
			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)) {
49 45
				// Obtener el vector con la ventanas de muestras
50 46
				for (int j = -semiLado; j <= semiLado; j++)
......
82 78
				rasterResult.setElem(line, col, band, (byte) raster.getElemByte(line, col, band));
83 79
			}
84 80
		}
81
		
82
		if(hasTransparency)  
83
			rasterResult.setElem(line, col, rasterResult.getBandCount() - 1, 
84
					raster.getElemByte(line, col, raster.getBandCount() - 1));
85 85
	}
86 86

  
87
	/*
88
	 * (non-Javadoc)
89
	 * @see org.gvsig.raster.grid.filter.segmentation.FirstDerivativeFilter#getInRasterDataType()
90
	 */
91 87
	public int getInRasterDataType() {
92 88
		return Buffer.TYPE_BYTE;
93 89
	}

Also available in: Unified diff