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

View differences:

RemoveBandsShortFilter.java
23 23
 */
24 24
package org.cresques.filter.bands;
25 25

  
26
import org.cresques.filter.RasterBuf;
26
import java.awt.image.BufferedImage;
27 27

  
28
import org.cresques.io.data.RasterBuf;
28 29

  
30

  
29 31
/**
30 32
 * Proceso del filtro de recorte de colas aplicado a im?genes 16 bits
31 33
 * @author Nacho Brodin (brodin_ign@gva.es)
32 34
 *
33 35
 */
34 36
public class RemoveBandsShortFilter extends RemoveBandsFilter {
37
	private short[] 		px = new short[4];
38
	
35 39
    public RemoveBandsShortFilter() {
36 40
    }
37 41

  
......
49 53
    /* (non-Javadoc)
50 54
     * @see org.cresques.io.raster.IRasterFilter#process(int, int)
51 55
     */
52
    public void process(int x, int y) {
53
        raster.getElemInt(x, y, px);
54
        px[0] = px[0] & m1;
55
        px[1] = px[1] & m2;
56
        px[2] = px[2] & m3;
57
        raster.setElemInt(x, y, px);
56
    public void process(int col, int line) {
57
    	 raster.getElemShort(line, col, px);
58
        px[0] = (short)(px[0] & m1);
59
        px[1] = (short)(px[1] & m2);
60
        px[2] = (short)(px[2] & m3);
61
        raster.setElemShort(line, col, px);
58 62
    }
59 63

  
60 64
    /* (non-Javadoc)
65
     * @see org.cresques.io.raster.IRasterFilter#processSuperSampling(int, int)
66
     */
67
    public void processSuperSampling(int col, int line) {
68
    	 raster.getElemShort(line, col, px);
69
    	 px[0] = (short)(px[0] & m1);
70
         px[1] = (short)(px[1] & m2);
71
         px[2] = (short)(px[2] & m3);
72
 		 for(int j = col; j < raster.getWidth() && j < (col + stepX[contX + 1]); j++)
73
			for(int i = line; i < raster.getHeight() && i < (line + stepY[contY + 1]); i++)
74
				 raster.setElemShort(i, j, px);
75
	}
76
    
77
    /* (non-Javadoc)
61 78
     * @see org.cresques.io.raster.IRasterFilter#getInRasterDataType()
62 79
     */
63 80
    public int getInRasterDataType() {

Also available in: Unified diff