Revision 9523 branches/piloto3d/libraries/libCq CMS for java.old/src/org/cresques/filter/statistics/ComputeMinMaxImageFilter.java

View differences:

ComputeMinMaxImageFilter.java
26 26
import java.awt.Image;
27 27
import java.awt.image.BufferedImage;
28 28

  
29
import org.cresques.filter.RasterBuf;
29
import org.cresques.io.data.RasterBuf;
30 30

  
31 31

  
32 32
/**
......
34 34
 * tipos de datos.
35 35
 */
36 36
public class ComputeMinMaxImageFilter extends ComputeMinMaxFilter {
37
    /**
37
    
38
	/**
38 39
     * Constructor
39 40
     *
40 41
     */
......
54 55
        super.pre();
55 56
    }
56 57

  
57
    /* (non-Javadoc)
58
     * @see org.cresques.io.raster.IRasterFilter#process(int, int)
58
    /**
59
     * Calcula el m?nimo y el m?ximo y lo salva sobre las variables de instancia min, max,
60
     * @param px
59 61
     */
60
    public void process(int x, int y) {
61
        int px = ((BufferedImage) image).getRGB(x, y);
62
    private void calcMinMax(int px){
63
    	int pxBand = ((px & 0xff0000) >> 16);
62 64

  
63
        int pxBand = ((px & 0xff0000) >> 16);
64

  
65 65
        if (pxBand < min[0]) {
66 66
            secondMin[0] = min[0];
67 67
            min[0] = pxBand;
......
107 107
        } else if ((pxBand > secondMax[2]) && (pxBand != max[2])) {
108 108
            secondMax[2] = pxBand;
109 109
        }
110

  
110 111
    }
112
    
113
    /* (non-Javadoc)
114
     * @see org.cresques.io.raster.IRasterFilter#process(int, int)
115
     */
116
    public void process(int col, int line) {
117
        int px = ((BufferedImage) image).getRGB(col, line);
118
        calcMinMax(px);
119
    }
111 120

  
112 121
    /* (non-Javadoc)
122
     * @see org.cresques.io.raster.IRasterFilter#processSuperSampling(int, int)
123
     */
124
    public void processSuperSampling(int col, int line) {
125
    	process(col, line);
126
	}
127

  
128
    /* (non-Javadoc)
113 129
     * @see org.cresques.io.raster.IRasterFilter#getInRasterDataType()
114 130
     */
115 131
    public int getInRasterDataType() {

Also available in: Unified diff