root / trunk / libraries / libCq_CMS_praster / src / org / cresques / filter / statistics / PercentTailTrimIntegerFilter.java @ 8026
History | View | Annotate | Download (1.92 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 |
* Proceso del filtro de recorte de colas aplicado a im?genes 32 bits
|
30 |
*
|
31 |
* @author Nacho Brodin (brodin_ign@gva.es)
|
32 |
*
|
33 |
*/
|
34 |
public class PercentTailTrimIntegerFilter extends PercentTailTrimFilter { |
35 |
|
36 |
private int[] px = new int[4]; |
37 |
|
38 |
public void process(int col, int line) { |
39 |
raster.getElemInt(line, col, px); |
40 |
sample[0][count] = px[0]; |
41 |
sample[1][count] = px[1]; |
42 |
sample[2][count] = px[2]; |
43 |
count++; |
44 |
} |
45 |
|
46 |
public void processSuperSampling(int col, int line) { |
47 |
process(col, line); |
48 |
|
49 |
} |
50 |
|
51 |
public void processLine(int y) { |
52 |
// TODO Auto-generated method stub
|
53 |
|
54 |
} |
55 |
|
56 |
public int getInRasterDataType() { |
57 |
return RasterBuf.TYPE_INT;
|
58 |
} |
59 |
|
60 |
public int getOutRasterDataType() { |
61 |
return RasterBuf.TYPE_INT;
|
62 |
} |
63 |
|
64 |
public void post() { |
65 |
super.post();
|
66 |
} |
67 |
|
68 |
public void pre() { |
69 |
//Obtenci?n de par?metros
|
70 |
this.raster = (RasterBuf) params.get("raster"); |
71 |
height = raster.getHeight(); |
72 |
width = raster.getWidth(); |
73 |
super.pre();
|
74 |
} |
75 |
|
76 |
} |