Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libRaster / src / org / gvsig / raster / grid / filter / enhancement / ContrastFilter.java @ 11864

History | View | Annotate | Download (3.12 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.gvsig.raster.grid.filter.enhancement;
21

    
22
import org.gvsig.raster.dataset.Params;
23
import org.gvsig.raster.grid.filter.RasterFilter;
24

    
25
/**
26
 * Clase base para todos los filtros de contraste
27
 * @author Miguel ?ngel Querol Carratal?  (miguelangel.querol@iver.es)
28
 *
29
 */
30
public class ContrastFilter extends RasterFilter {
31
        
32
        public static String                genericName = "contrast";
33
        
34
        /**
35
         * Variable que contendra el incremento del contraste.
36
         */
37
        int incrContraste = 0;
38
        
39
        /**
40
         * Valor que toma el pixel despues de aplicarle el algoritmo de 
41
         * mejora del contraste.
42
         */
43
        int result = 0;
44
        
45
        
46
        /**
47
         * Constructor
48
         */
49
        public ContrastFilter(){
50
                super();
51
                super.fName = genericName;
52
        }
53
        
54
        public void pre() {
55
        }
56

    
57
        public void post() {
58
        }
59

    
60
        /**
61
         * Obtiene el incremento de contraster que se est? aplicando
62
         * @return entero que representa el incremento de contraste aplicado.
63
         */
64
        public int getContrastIncrease(){
65
                return this.incrContraste;
66
        }
67
        
68
        /*
69
         * (non-Javadoc)
70
         * @see org.gvsig.raster.grid.filter.RasterFilter#getName()
71
         */
72
        public String getName() {
73
                return genericName;
74
        }
75

    
76
        /*
77
         * (non-Javadoc)
78
         * @see org.gvsig.raster.grid.filter.IRasterFilter#getGroup()
79
         */
80
        public String getGroup() {
81
                return "basics";
82
        }
83
        
84
        
85
        /*
86
         * (non-Javadoc)
87
         * @see org.gvsig.raster.grid.filter.IRasterFilter#getParams()
88
         */
89
        public Params getUIParams() {
90
                Params params = new Params();
91
                params.setParam("Contrast",
92
                                incrContraste + "",
93
                                Params.SLIDER,
94
                                new String[]{ "-255", "255", "50", "1", "25" }); //min, max, valor defecto, intervalo peque?o, intervalo grande;
95
                return params;
96
        }
97

    
98
        /*
99
         * (non-Javadoc)
100
         * @see org.gvsig.raster.grid.filter.RasterFilter#getInRasterDataType()
101
         */
102
        public int getInRasterDataType() {
103
                return 0;
104
        }
105

    
106
        /*
107
         * (non-Javadoc)
108
         * @see org.gvsig.raster.grid.filter.RasterFilter#getOutRasterDataType()
109
         */
110
        public int getOutRasterDataType() {
111
                return 0;
112
        }
113

    
114
        /*
115
         * (non-Javadoc)
116
         * @see org.gvsig.raster.grid.filter.RasterFilter#getResult(java.lang.String)
117
         */
118
        public Object getResult(String name) {
119
                return null;
120
        }
121

    
122
        /*
123
         * (non-Javadoc)
124
         * @see org.gvsig.raster.grid.filter.RasterFilter#process(int, int)
125
         */
126
        public void process(int x, int y) {
127
        }
128
        
129
        public Object clone() throws CloneNotSupportedException {
130
    Object obj = null;
131
                obj = super.clone();
132
                return obj;
133
        }        
134
}