Revision 22487 trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/mosaic/process/FeatherProcessBuff.java

View differences:

FeatherProcessBuff.java
95 95
	private String fileName = null;
96 96
	int percent = 0;
97 97

  
98
	//Variables auxiliares:
99
	private double distances[] = null;
100
	private byte values[] = null;
101
	private double totalD = 0;
102
	private double result[] = null;
103

  
98 104
	public void init() {
99 105

  
100 106
		// Obtener las capas que intervienen en el mosaico.
......
132 138
			RasterToolsUtil.messageBoxError("buffer_incorrecto", this, e);
133 139
		}
134 140
		fileName = getStringParam("filename");
141
		values = new byte[resultbandCount];
142
		result = new double[resultbandCount];
135 143

  
136 144
	}
137 145

  
138 146
	public void process() throws InterruptedException {
139 147
		// Calculara las lineas de borde (entre 0, 3 o 4 lineas)
140 148
		calculateBorders();
149
		distances = new double[borders.length];
141 150

  
142 151
		// Construccion de los buffers de entrada:
143 152
		IRasterDataSource dsetCopy = null;
......
306 315
	private void setFeatherValue(int col, int row) throws OutOfGridException {
307 316
		Point2D worldPoint = rasterToWorld(col, row);
308 317

  
309
		double distances[] = new double[borders.length];
310
		byte values[] = new byte[resultbandCount];
311
		double totalD = 0;
312
		double result[] = new double[resultbandCount];
318
		totalD = 0;
313 319

  
314 320
		for (int i = 0; i < borders.length; i++) {
315 321

  
......
325 331

  
326 332
			inputBuffers[i].getElemByte(row, col, values);
327 333
			for (int band = 0; band < resultbandCount; band++) {
328
				result[band] = result[band] + values[band] * distances[i];
334
				result[band] = result[band] + (values[band] & 0xff) * distances[i];
329 335
			}
330 336
		}
331 337

  

Also available in: Unified diff