Statistics
| Revision:

root / trunk / libraries / libCq_CMS_praster / src / org / cresques / filter / statistics / PercentTailTrimShortFilter.java @ 8026

History | View | Annotate | Download (2.57 KB)

1
/*
2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 *
4
 * Copyright (C) 2004-5.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 * cresques@gmail.com
23
 */
24
package org.cresques.filter.statistics;
25

    
26
import org.cresques.io.data.RasterBuf;
27

    
28

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

    
40
    /* (non-Javadoc)
41
     * @see org.cresques.io.raster.IRasterFilter#pre()
42
     */
43
    public void pre() {
44
        //Obtenci?n de par?metros
45
        this.raster = (RasterBuf) params.get("raster");
46
        height = raster.getHeight();
47
        width = raster.getWidth();
48
        super.pre();
49
    }
50

    
51
    /* (non-Javadoc)
52
     * @see org.cresques.io.raster.IRasterFilter#process(int, int)
53
     */
54
    public void process(int col, int line) {
55
        raster.getElemShort(line, col, px);
56
        sample[0][count] = px[0];
57
        sample[1][count] = px[1];
58
        sample[2][count] = px[2];
59
        count++;
60
    }
61

    
62
    /* (non-Javadoc)
63
     * @see org.cresques.io.raster.IRasterFilter#processSuperSampling(int, int)
64
     */
65
    public void processSuperSampling(int col, int line) {
66
            process(col, line);                
67
        }
68
    
69
    /* (non-Javadoc)
70
     * @see org.cresques.io.raster.IRasterFilter#getInRasterDataType()
71
     */
72
    public int getInRasterDataType() {
73
        return RasterBuf.TYPE_SHORT;
74
    }
75

    
76
    /* (non-Javadoc)
77
     * @see org.cresques.io.raster.IRasterFilter#getOutRasterDataType()
78
     */
79
    public int getOutRasterDataType() {
80
        return RasterBuf.TYPE_SHORT;
81
    }
82

    
83
    /* (non-Javadoc)
84
     * @see org.cresques.io.raster.RasterFilter#processLine(int)
85
     */
86
    public void processLine(int y) {
87
    }
88

    
89
    public void post() {
90
        super.post();
91
    }
92
}