Revision 30008 branches/v2_0_0_prep/libraries/libRaster/src/org/gvsig/raster/grid/filter/RasterFilter.java

View differences:

RasterFilter.java
138 138
	 */
139 139
	public RasterFilter() {
140 140
	}
141
	
141

  
142 142
	/**
143 143
	 * Instancia un filtro a partir de su nombre
144
	 * @param strPackage Paquete 
144
	 * @param strPackage Paquete
145 145
	 * @return Filtro instanciado
146 146
	 * @throws FilterTypeException
147 147
	 */
......
152 152
		} catch (ClassNotFoundException e) {
153 153
			throw new FilterTypeException("No puedo instanciar " + strPackage.trim());
154 154
		}
155
		
155

  
156 156
		Constructor con = null;
157 157
		try {
158 158
			con = filterClass.getConstructor(null);
......
161 161
		} catch (NoSuchMethodException e) {
162 162
			throw new FilterTypeException("");
163 163
		}
164
		
164

  
165 165
		RasterFilter newFilter = null;
166 166
		try {
167 167
			newFilter = (RasterFilter) con.newInstance(null);
......
187 187
		if (raster != null && raster.getDataType() != this.getInRasterDataType())
188 188
			exec = false;
189 189
		percent = 0;
190
		if (exec) {
190
		if (exec)
191 191
			for (int row = 0; row < height; row ++) {
192 192
				for (int col = 0; col < width; col ++)
193
					process(col, row);
193
					try {
194
						process(col, row);
195
					}catch (ArrayIndexOutOfBoundsException e) {
196
					}
194 197

  
195 198
				if (task.getEvent() != null)
196 199
					task.manageEvent(task.getEvent());
197 200

  
198 201
				percent = (row * 100) / height;
199 202
			}
200
		}
201 203
		percent = 100;
202 204
		post();
203 205
	}
......
380 382
			transparency.activeTransparency();
381 383
		}
382 384
	}
385

  
386
	/**
387
	 * Releases buffer resources
388
	 */
389
	public void free() {
390
		if (raster != null)
391
			raster.free();
392
		if (rasterResult != null)
393
			rasterResult.free();
394
		rasterResult = null;
395
		raster = null;
396
	}
383 397
}

Also available in: Unified diff