Statistics
| Revision:

gvsig-raster / org.gvsig.raster / branches / org.gvsig.raster.2.4 / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.buffer / org.gvsig.raster.lib.buffer.api / src / main / java / org / gvsig / raster / lib / buffer / api / Histogram.java @ 5439

History | View | Annotate | Download (6.11 KB)

1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2016 gvSIG Association
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., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.raster.lib.buffer.api;
24

    
25
import org.gvsig.tools.task.SimpleTaskStatus;
26

    
27

    
28
/**
29
 * @author fdiaz
30
 *
31
 */
32
public interface Histogram {
33

    
34
    /**
35
     * Obtiene el n?mero de bandas del histograma
36
     * @return entero que representa el n?mero de bandas
37
     */
38
    public int getNumBands();
39

    
40
    /**
41
     * Obtiene la longitud (n?mero de valores) de una banda determinada
42
     * @param band Banda o obtener la longitud
43
     * @return entero con la longitud de la banda
44
     * rangos de valores y DataclassList.
45
     */
46
    public int getBandLenght(int band);
47

    
48
    /**
49
     * Obtiene el tipo de datos del histograma original
50
     *
51
     * @return el tipo de datos del histograma original
52
     */
53
    public int getDataType();
54

    
55
    /**
56
     * Obtiene un valor del histograma segun la posicion dentro de las clases
57
     * @param band N?mero de banda del valor a recuperar
58
     * @param pos Pixel o valor de la clase del valor a recuperar
59
     *
60
     * @return valor
61
     */
62
    public double getHistogramValueByPos(int band, int pos);
63

    
64
    /**
65
     * Obtiene un valor del histograma
66
     * @param band N?mero de banda del valor a recuperar
67
     * @param px Pixel o valor de la clase del valor a recuperar
68
     * @return valor
69
     */
70
    public double getHistogramValue(int band, double px);
71

    
72
    /**
73
     * Realiza la uni?n entre el histograma actual y el pasado
74
     * por par?metro.
75
     * @param hist
76
     * @return true if the union has been possible
77
     */
78
    public boolean union(Histogram hist);
79

    
80
    /**
81
     * Obtiene la tabla de valores
82
     *
83
     * @return la tabla de valores
84
     */
85
    public long[][] getTable();
86

    
87

    
88
    /**
89
     * Obtiene el histograma de la imagen negativa.
90
     *
91
     * @return el histograma de la imagen negativa.
92
     */
93
    public long[][] getNegativeTable();
94

    
95
    /**
96
     * Devuelve el minimo valor del histograma
97
     *
98
     * @return el minimo valor del histograma
99
     */
100
    public double getMinimum();
101

    
102
    /**
103
     * Devuelve el maximo valor del histograma
104
     *
105
     * @return el maximo valor del histograma
106
     */
107
    public double getMaximum();
108

    
109
    /**
110
     * Obtiene el n?mero de valores o clases del histograma
111
     * @return entero que representa el n?mero de valores o clases del histograma
112
     */
113
    public int getNumValues();
114

    
115
    /**
116
     * Devuelve si un histograma esta en un rango RGB aceptable
117
     *
118
     * @return si un histograma esta en un rango RGB aceptable
119
     */
120
    public boolean isInRangeRGB();
121

    
122
    /**
123
     * Calculo de estad?sticas a partir de un histograma. El resultado de la funci?n es un array
124
     * bidimensional donde el primer ?ndice inndica la estadistica y el segundo el n?mero de banda.
125
     *
126
     * <UL>
127
     * <LI>m?nimo</LI>
128
     * <LI>m?ximo</LI>
129
     * <LI>media</LI>
130
     * <LI>mediana</LI>
131
     * <LI>N?mero de pixels</LI>
132
     * </UL>
133
     * @param histogram
134
     * @param beginPos Posici?n de inicio del histograma para contabilizar estadisticas
135
     * @param endPos Posici?n de fin del histograma para contabilizar estadisticas
136
     * @param bands bandas solicitadas. Cada elemento del vector representa una banda. Si est? a true se calcula la
137
     * estadistica para esa banda y si est? a false no se calcular?.
138
     *
139
     * @return las estad?sticas a partir del histograma.
140
     */
141
    public double[][] getBasicStats(double beginPos, double endPos, boolean[] bands);
142

    
143
    /**
144
     * Calculo de estad?sticas a partir de un histograma. El resultado de la funci?n es un array
145
     * bidimensional donde el primer ?ndice inndica la estadistica y el segundo el n?mero de banda.
146
     *
147
     * <UL>
148
     * <LI>m?nimo</LI>
149
     * <LI>m?ximo</LI>
150
     * <LI>media</LI>
151
     * <LI>mediana</LI>
152
     * <LI>N?mero de pixels</LI>
153
     * </UL>
154
     * @param histogram
155
     * @param bands bandas solicitadas. Cada elemento del vector representa una banda. Si est? a true se calcula la
156
     * estadistica para esa banda y si est? a false no se calcular?.
157
     *
158
     * @return las estad?sticas a partir del histograma.
159
     */
160
    public double[][] getBasicStats(boolean[] bands);
161

    
162
    /**
163
     * Calcula las estad?sticas.
164
     *
165
     * @param status
166
     */
167
    public void calculate(SimpleTaskStatus status);
168

    
169
    /**
170
     * @return true if the histogram has been calculated
171
     */
172
    public boolean isCalculated();
173

    
174
    /**
175
     * Devuelve los valores m?nimos de todas las bandas
176
     *
177
     * @return los valores m?nimos de todas las bandas
178
     */
179
    public double[] getMin();
180

    
181
    /**
182
     * Devuelve los valores m?nimos de todas las bandas
183
     *
184
     * @return los valores m?nimos de todas las bandas
185
     */
186
    public double[] getMax();
187

    
188
    /**
189
     * Devuelve el n?mero de valores de un intervalo
190
     *
191
     * @param band
192
     * @param interval
193
     * @return el n?mero de valores del intervalo
194
     */
195
    public int getValueCount(int band, int interval);
196

    
197
    /**
198
     * Devuelve el valor m?nimo de un intervalo
199
     *
200
     * @param band
201
     * @param interval
202
     * @return el valor m?nimo del intervalo
203
     */
204
    public int getIntervalMin(int band, int interval);
205

    
206
    /**
207
     * Devuelve el valor m?ximo de un intervalo
208
     *
209
     * @param band
210
     * @param interval
211
     * @return el valor m?ximo del intervalo
212
     */
213
    public int getIntervalMax(int band, int interval);
214

    
215

    
216

    
217
}