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/correction/ModeIntFilter.java

View differences:

ModeIntFilter.java
22 22
package org.gvsig.raster.impl.grid.filter.correction;
23 23

  
24 24
import org.gvsig.fmap.dal.coverage.dataset.Buffer;
25
import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
25 26

  
26 27
/**
27 28
 * Proceso que aplica el filtro de Moda a un raster de tipo entero
28 29
 * 
29
 * 23/07/2008
30 30
 * @author Nacho Brodin nachobrodin@gmail.com
31 31
 */
32 32
public class ModeIntFilter extends ModeFilter {
33
	private int[]                   window = null;
33
	private int[]                   window          = null;
34 34
	private int                     tempValue       = 0;
35 35

  
36 36
	public ModeIntFilter() {
37 37
		super();
38 38
	}
39 39

  
40
	/*
41
	 * (non-Javadoc)
42
	 * @see org.gvsig.raster.grid.filter.correction.MedianFilter#pre()
43
	 */
44
	public void pre() {
40
	public void pre() throws FilterAddException {
45 41
		super.pre();
46 42
		window = new int[sizeWindow];
47 43
	}
48 44

  
49
	/*
50
	 * (non-Javadoc)
51
	 * @see org.gvsig.raster.grid.filter.correction.MedianFilter#process(int, int)
52
	 */
53 45
	public void process(int col, int line) {
54
		for (int band = 0; band < raster.getBandCount(); band++) {
46
		for (int band = 0; band < numberOfBandsToProcess(); band++) {
55 47
			int k = 0;
56 48
			count = 0;
57 49
			for (int i = -halfSide; i <= halfSide; i++) {
......
89 81
		}
90 82
	}
91 83

  
92
	/*
93
	 * (non-Javadoc)
94
	 * @see org.gvsig.raster.grid.filter.correction.MedianFilter#getInRasterDataType()
95
	 */
96 84
	public int getInRasterDataType() {
97 85
		return Buffer.TYPE_INT;
98 86
	}
99 87

  
100
	/*
101
	 * (non-Javadoc)
102
	 * @see org.gvsig.raster.grid.filter.RasterFilter#getOutRasterDataType()
103
	 */
104 88
	public int getOutRasterDataType() {
105 89
		return Buffer.TYPE_INT;
106 90
	}

Also available in: Unified diff