root / trunk / libraries / libCq_CMS_praster / src / org / cresques / filter / convolution / ConvolutionFilter.java @ 8026
History | View | Annotate | Download (1.98 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*/
|
19 |
|
20 |
package org.cresques.filter.convolution; |
21 |
|
22 |
import java.awt.Image; |
23 |
|
24 |
import org.cresques.filter.RasterFilter; |
25 |
import org.cresques.io.data.RasterBuf; |
26 |
import org.gvsig.i18n.Messages; |
27 |
|
28 |
/**
|
29 |
* Clase base para los filtros de convoluci?n.
|
30 |
*
|
31 |
* @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
|
32 |
*
|
33 |
*/
|
34 |
|
35 |
public abstract class ConvolutionFilter extends RasterFilter { |
36 |
protected Kernel kernel = null; |
37 |
protected int umbral = 0; |
38 |
protected Image imageResult = null; |
39 |
protected RasterBuf rasterResult = null; |
40 |
|
41 |
public ConvolutionFilter() {
|
42 |
super();
|
43 |
// TODO Auto-generated constructor stub
|
44 |
} |
45 |
|
46 |
/**
|
47 |
* Constructor para la asignaci?n del identificador del filtro
|
48 |
* @param fName Cadena que representa el identificador del filtro
|
49 |
*/
|
50 |
public ConvolutionFilter(String fName) { |
51 |
super();
|
52 |
super.filterName = fName;
|
53 |
} |
54 |
|
55 |
public void post() { |
56 |
// TODO Auto-generated method stub
|
57 |
} |
58 |
|
59 |
public void pre() { |
60 |
kernel = (Kernel) params.get("kernel"); |
61 |
if (params.get("umbral")!=null) |
62 |
umbral = ((Integer)params.get("umbral")).intValue(); |
63 |
else this.umbral = 0; |
64 |
} |
65 |
|
66 |
/**
|
67 |
* Obtiene el kernel
|
68 |
* @return kernel asociado al filtro
|
69 |
*/
|
70 |
public Kernel getKernel() { |
71 |
return kernel;
|
72 |
} |
73 |
} |