Revision 21032
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.raster.cache.tile.TileCacheLibrary |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/Histogramable.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.raster.cache.buffer.histogram; |
|
23 |
|
|
24 |
import org.gvsig.raster.cache.buffer.exception.HistogramException; |
|
25 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
|
26 |
|
|
27 |
|
|
28 |
/** |
|
29 |
* This interface should be implemented for every class that is capable to |
|
30 |
* provide an object to compute its histogram. |
|
31 |
* |
|
32 |
* @version 27/03/2007 |
|
33 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
34 |
* |
|
35 |
*/ |
|
36 |
public interface Histogramable { |
|
37 |
|
|
38 |
/** |
|
39 |
* Gets the object which computes the histogram |
|
40 |
* @return Histograma |
|
41 |
*/ |
|
42 |
public HistogramComputer getHistogramComputer() throws HistogramException, ProcessInterruptedException; |
|
43 |
|
|
44 |
} |
|
0 | 45 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/HistogramClass.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.raster.cache.buffer.histogram; |
|
23 |
|
|
24 |
|
|
25 |
/** |
|
26 |
* Clase que define un intervalo de datos. Es util para cosas como el calculo de histogramas |
|
27 |
* con tipo de datos en coma flotante en el cual hay que dividir los intervalos en |
|
28 |
* clases. Las clases se tendr?n en cuenta como un intervalo el cual el menor es cerrado y el |
|
29 |
* mayor abierto, es decir |
|
30 |
* <PRE> |
|
31 |
* En las clases: |
|
32 |
* 0-1000 |
|
33 |
* 1000-2000 |
|
34 |
* los intervalos son |
|
35 |
* [0, 1000 [ de 0-999.9p |
|
36 |
* [1000, 2000[ de 1000-1999.9p |
|
37 |
* </PRE> |
|
38 |
* |
|
39 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
40 |
* |
|
41 |
*/ |
|
42 |
public interface HistogramClass { |
|
43 |
|
|
44 |
/** |
|
45 |
* Comprueba si el valor pasado por par?metro est? dentro del intervalo |
|
46 |
* @param value Valor a comprobar |
|
47 |
* @return true si est? dentro del intervalo y false si no lo est? |
|
48 |
*/ |
|
49 |
public boolean isIn(double value); |
|
50 |
|
|
51 |
/** |
|
52 |
* Obtiene el valor m?ximo de la clase |
|
53 |
* @return Entero que representa al valor m?ximo de la clase |
|
54 |
*/ |
|
55 |
public double getMax(); |
|
56 |
|
|
57 |
/** |
|
58 |
* Asigna el valor m?ximo de la clase |
|
59 |
* @param max Entero que representa al valor m?ximo de la clase |
|
60 |
*/ |
|
61 |
public void setMax(double max); |
|
62 |
|
|
63 |
/** |
|
64 |
* Obtiene el valor m?nimo de la clase |
|
65 |
* @return Entero que representa al valor m?nimo de la clase |
|
66 |
*/ |
|
67 |
public double getMin(); |
|
68 |
|
|
69 |
/** |
|
70 |
* ASigna el valor m?nimo de la clase |
|
71 |
* @param min Entero que representa al valor m?nimo de la clase |
|
72 |
*/ |
|
73 |
public void setMin(double min); |
|
74 |
|
|
75 |
/** |
|
76 |
* Obtiene el valor de la clase |
|
77 |
* @return double con el valor |
|
78 |
*/ |
|
79 |
public double getValue(); |
|
80 |
|
|
81 |
/** |
|
82 |
* Asigna el valor de la clase |
|
83 |
* @param double con el valor |
|
84 |
*/ |
|
85 |
public void setValue(double value); |
|
86 |
|
|
87 |
/** |
|
88 |
* Incrementa en n el valor especificado |
|
89 |
* @param double n |
|
90 |
*/ |
|
91 |
public void increment(double n); |
|
92 |
} |
|
0 | 93 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/BufferHistogram.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.raster.cache.buffer.histogram; |
|
23 |
|
|
24 |
import org.gvsig.raster.cache.buffer.BufferNoData; |
|
25 |
|
|
26 |
/** |
|
27 |
* Interfaz que representa un histograma. |
|
28 |
* |
|
29 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
30 |
*/ |
|
31 |
public interface BufferHistogram { |
|
32 |
/** |
|
33 |
* Obtiene el n?mero de bandas del histograma |
|
34 |
* @return entero que representa el n?mero de bandas |
|
35 |
*/ |
|
36 |
public int getNumBands(); |
|
37 |
|
|
38 |
/** |
|
39 |
* Obtiene la longitud (n?mero de valores) de una banda determinada |
|
40 |
* @param band Banda o obtener la longitud |
|
41 |
* @return entero con la longitud de la banda |
|
42 |
* rangos de valores y DataclassList. |
|
43 |
*/ |
|
44 |
public int getBandLenght(int band); |
|
45 |
|
|
46 |
/** |
|
47 |
* Obtiene el tipo de datos del histograma original |
|
48 |
* @return |
|
49 |
*/ |
|
50 |
public int getDataType(); |
|
51 |
|
|
52 |
/** |
|
53 |
* Asigna un valor para una posici?n del histograma segun la posicion en las |
|
54 |
* clases |
|
55 |
* @param band Valor del pixel o clase a asignar |
|
56 |
* @param pos Posicion dentro de la clase. Ejemplo 0..63 |
|
57 |
* @param value Valor a asignar |
|
58 |
*/ |
|
59 |
public void setHistogramValueByPos(int band, int pos, long value); |
|
60 |
|
|
61 |
/** |
|
62 |
* Obtiene un valor del histograma segun la posicion dentro de las clases |
|
63 |
* @param band N?mero de banda del valor a recuperar |
|
64 |
* @param px Pixel o valor de la clase del valor a recuperar |
|
65 |
* @return valor |
|
66 |
*/ |
|
67 |
public double getHistogramValueByPos(int band, int pos); |
|
68 |
|
|
69 |
/** |
|
70 |
* Obtiene un valor del histograma |
|
71 |
* @param band N?mero de banda del valor a recuperar |
|
72 |
* @param px Pixel o valor de la clase del valor a recuperar |
|
73 |
* @return valor |
|
74 |
*/ |
|
75 |
public double getHistogramValue(int band, double px); |
|
76 |
|
|
77 |
/** |
|
78 |
* Realiza la uni?n entre el histograma actual y el pasado |
|
79 |
* por par?metro. |
|
80 |
* @param hist |
|
81 |
*/ |
|
82 |
public boolean union(BufferHistogram hist); |
|
83 |
|
|
84 |
/** |
|
85 |
* Obtiene la tabla de valores |
|
86 |
* @return |
|
87 |
*/ |
|
88 |
public long[][] getTable(); |
|
89 |
|
|
90 |
/** |
|
91 |
* Asigna la tabla |
|
92 |
* @param t |
|
93 |
*/ |
|
94 |
public void setTable(long[][] t); |
|
95 |
|
|
96 |
/** |
|
97 |
* Obtiene el histograma sin modificar |
|
98 |
* @return array bidimensional donde el primer elemento es el valor del pixel |
|
99 |
* o rango y el segundo el n?mero de elementos que aparecen. |
|
100 |
*/ |
|
101 |
public HistogramClass[][] getHistogram(); |
|
102 |
|
|
103 |
/** |
|
104 |
* Obtiene el histograma de la imagen negativa. |
|
105 |
* @return long[][] |
|
106 |
*/ |
|
107 |
public long[][] getNegativeTable(); |
|
108 |
|
|
109 |
/** |
|
110 |
* Devuelve el minimo valor del histograma |
|
111 |
* @return |
|
112 |
*/ |
|
113 |
public double getMin(int band); |
|
114 |
|
|
115 |
/** |
|
116 |
* Devuelve el maximo valor del histograma |
|
117 |
* @return |
|
118 |
*/ |
|
119 |
public double getMax(int band); |
|
120 |
|
|
121 |
/** |
|
122 |
* Obtiene el n?mero de valores o clases del histograma |
|
123 |
* @return entero que representa el n?mero de valores o clases del histograma |
|
124 |
*/ |
|
125 |
public int getNumValues(); |
|
126 |
|
|
127 |
/** |
|
128 |
* Devuelve si un histograma esta en un rango RGB aceptable |
|
129 |
* @return |
|
130 |
*/ |
|
131 |
public boolean isInRangeRGB(); |
|
132 |
|
|
133 |
/** |
|
134 |
* Calculo de estad?sticas a partir de un histograma. El resultado de la funci?n es un array |
|
135 |
* bidimensional donde el primer ?ndice inndica la estadistica y el segundo el n?mero de banda. |
|
136 |
* |
|
137 |
* <UL> |
|
138 |
* <LI>m?nimo</LI> |
|
139 |
* <LI>m?ximo</LI> |
|
140 |
* <LI>media</LI> |
|
141 |
* <LI>mediana</LI> |
|
142 |
* <LI>N?mero de pixels</LI> |
|
143 |
* </UL> |
|
144 |
* @param histogram |
|
145 |
* @param beginPos Posici?n de inicio del histograma para contabilizar estadisticas |
|
146 |
* @param endPos Posici?n de fin del histograma para contabilizar estadisticas |
|
147 |
* @param bandas solicitadas. Cada elemento del vector representa una banda. Si est? a true se calcula la |
|
148 |
* estadistica para esa banda y si est? a false no se calcular?. |
|
149 |
* @return |
|
150 |
*/ |
|
151 |
public double[][] getBasicStats(double beginPos2, double endPos2, boolean[] bands); |
|
152 |
|
|
153 |
/** |
|
154 |
* Calculo de estad?sticas a partir de un histograma. El resultado de la funci?n es un array |
|
155 |
* bidimensional donde el primer ?ndice inndica la estadistica y el segundo el n?mero de banda. |
|
156 |
* |
|
157 |
* <UL> |
|
158 |
* <LI>m?nimo</LI> |
|
159 |
* <LI>m?ximo</LI> |
|
160 |
* <LI>media</LI> |
|
161 |
* <LI>mediana</LI> |
|
162 |
* <LI>N?mero de pixels</LI> |
|
163 |
* </UL> |
|
164 |
* @param histogram |
|
165 |
* @param bandas solicitadas. Cada elemento del vector representa una banda. Si est? a true se calcula la |
|
166 |
* estadistica para esa banda y si est? a false no se calcular?. |
|
167 |
* @return |
|
168 |
*/ |
|
169 |
public double[][] getBasicStats(boolean[] bands); |
|
170 |
|
|
171 |
/** |
|
172 |
* Adds a new table |
|
173 |
* @param table |
|
174 |
*/ |
|
175 |
public void addTable(long[][] table); |
|
176 |
|
|
177 |
/** |
|
178 |
* Incrementa un valor de una posici?n del histograma |
|
179 |
* @param band N?mero de banda |
|
180 |
* @param px Pixel o valor de la clase |
|
181 |
*/ |
|
182 |
public void incrementPxValue(int band, double px); |
|
183 |
|
|
184 |
/** |
|
185 |
* @param noDataValue the noDataValue to set |
|
186 |
*/ |
|
187 |
public void setNoDataValue(BufferNoData noDataValue); |
|
188 |
} |
|
0 | 189 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/HistogramComputer.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.raster.cache.buffer.histogram; |
|
23 |
|
|
24 |
import org.gvsig.raster.cache.buffer.exception.HistogramException; |
|
25 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
|
26 |
|
|
27 |
/** |
|
28 |
* |
|
29 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
30 |
*/ |
|
31 |
public interface HistogramComputer { |
|
32 |
|
|
33 |
/** |
|
34 |
* Obtiene el minimo valor de las estadisticas de un histograma. |
|
35 |
* @return double |
|
36 |
*/ |
|
37 |
public double getMinimum(); |
|
38 |
|
|
39 |
/** |
|
40 |
* Obtiene el maximo valor de las estadisticas de un histograma. |
|
41 |
* @return double |
|
42 |
*/ |
|
43 |
public double getMaximum(); |
|
44 |
|
|
45 |
/** |
|
46 |
* Obtiene el histograma. |
|
47 |
* @return histograma |
|
48 |
*/ |
|
49 |
public BufferHistogram getBufferHistogram(int numberOfClasses) throws HistogramException, ProcessInterruptedException; |
|
50 |
|
|
51 |
/** |
|
52 |
* Pone a cero el porcentaje de progreso del proceso de calculo de histograma |
|
53 |
*/ |
|
54 |
public void resetPercent(); |
|
55 |
|
|
56 |
/** |
|
57 |
* Obtiene el porcentaje de progreso del proceso de calculo de histograma |
|
58 |
* @return porcentaje de progreso |
|
59 |
*/ |
|
60 |
public int getPercent(); |
|
61 |
|
|
62 |
/** |
|
63 |
* Force to recalculate the histogram next time that the method getBufferHistogram |
|
64 |
* be called |
|
65 |
*/ |
|
66 |
public void refreshHistogram(); |
|
67 |
|
|
68 |
} |
|
0 | 69 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/histogram/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.raster.cache.buffer.histogram package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Classes to get a buffer histogram</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
</p> |
|
14 |
|
|
15 |
</body> |
|
16 |
</html> |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/StatsValues.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
/** |
|
4 |
* Interface implemented by a raster band with statistics |
|
5 |
* capabilities. |
|
6 |
* |
|
7 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
8 |
* |
|
9 |
*/ |
|
10 |
public interface StatsValues { |
|
11 |
/** |
|
12 |
* Get the maximun value |
|
13 |
* @return double |
|
14 |
*/ |
|
15 |
public double getMax(); |
|
16 |
|
|
17 |
/** |
|
18 |
* Set the maximun value |
|
19 |
* @param max |
|
20 |
*/ |
|
21 |
public void setMax(double max); |
|
22 |
|
|
23 |
/** |
|
24 |
* Get the minimun value |
|
25 |
* @return double |
|
26 |
*/ |
|
27 |
public double getMin(); |
|
28 |
|
|
29 |
/** |
|
30 |
* Set the minimun value |
|
31 |
* @param max |
|
32 |
*/ |
|
33 |
public void setMin(double min); |
|
34 |
|
|
35 |
/** |
|
36 |
* Get the second maximun value |
|
37 |
* @return double |
|
38 |
*/ |
|
39 |
public double getSecondMax(); |
|
40 |
|
|
41 |
/** |
|
42 |
* Set the second maximun value |
|
43 |
* @param max |
|
44 |
*/ |
|
45 |
public void setSecondMax(double secondMax); |
|
46 |
|
|
47 |
/** |
|
48 |
* Get the second minimun value |
|
49 |
* @return double |
|
50 |
*/ |
|
51 |
public double getSecondMin(); |
|
52 |
|
|
53 |
/** |
|
54 |
* Set the second minimun value |
|
55 |
* @param max |
|
56 |
*/ |
|
57 |
public void setSecondMin(double secondMin); |
|
58 |
|
|
59 |
/** |
|
60 |
* Get the maximun value in a eight bits band. |
|
61 |
* A value of eight bits has a range betwen -127 and 128. |
|
62 |
* The maximun is readed in a range betwen 0 and 255. |
|
63 |
* @return |
|
64 |
*/ |
|
65 |
public double getMaxRGB(); |
|
66 |
|
|
67 |
/** |
|
68 |
* Set the maximun value in a eight bits band. |
|
69 |
* A value of eight bits has a range betwen -127 and 128. |
|
70 |
* The maximun is writed in a range betwen 0 and 255. |
|
71 |
* @return |
|
72 |
*/ |
|
73 |
public void setMaxRGB(double maxRGB); |
|
74 |
|
|
75 |
/** |
|
76 |
* Get the minimun value in a eight bits band. |
|
77 |
* A value of eight bits has a range betwen -127 and 128. |
|
78 |
* The minimun is readed in a range betwen 0 and 255. |
|
79 |
* @return |
|
80 |
*/ |
|
81 |
public double getMinRGB(); |
|
82 |
|
|
83 |
/** |
|
84 |
* Set the minimun value in a eight bits band. |
|
85 |
* A value of eight bits has a range betwen -127 and 128. |
|
86 |
* The minimun is readed in a range betwen 0 and 255. |
|
87 |
* @param minRGB |
|
88 |
*/ |
|
89 |
public void setMinRGB(double minRGB); |
|
90 |
|
|
91 |
/** |
|
92 |
* Get the second maximun value in a eight bits band. |
|
93 |
* A value of eight bits has a range betwen -127 and 128. |
|
94 |
* The second maximun is readed in a range betwen 0 and 255. |
|
95 |
* @return |
|
96 |
*/ |
|
97 |
public double getSecondMaxRGB(); |
|
98 |
|
|
99 |
/** |
|
100 |
* Set the second maximun value in a eight bits band. |
|
101 |
* A value of eight bits has a range betwen -127 and 128. |
|
102 |
* The second maximun is writed in a range betwen 0 and 255. |
|
103 |
* @return |
|
104 |
*/ |
|
105 |
public void setSecondMaxRGB(double secondMaxRGB); |
|
106 |
|
|
107 |
/** |
|
108 |
* Get the second minimun value in a eight bits band. |
|
109 |
* A value of eight bits has a range betwen -127 and 128. |
|
110 |
* The second minimun is readed in a range betwen 0 and 255. |
|
111 |
* @return |
|
112 |
*/ |
|
113 |
public double getSecondMinRGB(); |
|
114 |
|
|
115 |
/** |
|
116 |
* Set the second minimun value in a eight bits band. |
|
117 |
* A value of eight bits has a range betwen -127 and 128. |
|
118 |
* The second minimun is readed in a range betwen 0 and 255. |
|
119 |
* @param minRGB |
|
120 |
*/ |
|
121 |
public void setSecondMinRGB(double secondMinRGB); |
|
122 |
|
|
123 |
/** |
|
124 |
* Get the mean value in this band |
|
125 |
* @return |
|
126 |
*/ |
|
127 |
public double getMean(); |
|
128 |
|
|
129 |
/** |
|
130 |
* Get the mean value in this band |
|
131 |
* @param mean |
|
132 |
*/ |
|
133 |
public void setMean(double mean); |
|
134 |
|
|
135 |
} |
|
0 | 136 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/InvalidPageNumberException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* Excepci?n lanzada cuando el n?mero de p?gina al que se intenta acceder no es valido. |
|
5 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
6 |
* |
|
7 |
*/ |
|
8 |
public class InvalidPageNumberException extends Exception { |
|
9 |
private static final long serialVersionUID = -4312548276663417111L; |
|
10 |
|
|
11 |
public InvalidPageNumberException(String msg){ |
|
12 |
super(msg); |
|
13 |
} |
|
14 |
} |
|
0 | 15 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/HistogramException.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.raster.cache.buffer.exception; |
|
23 |
/** |
|
24 |
* Excepci?n lanzada por errores en el calculo de histogramas. |
|
25 |
* |
|
26 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
27 |
*/ |
|
28 |
public class HistogramException extends Exception { |
|
29 |
private static final long serialVersionUID = 666908550965442025L; |
|
30 |
|
|
31 |
public HistogramException(String msg, Throwable e) { |
|
32 |
super(msg, e); |
|
33 |
} |
|
34 |
|
|
35 |
public HistogramException(String msg){ |
|
36 |
super(msg); |
|
37 |
} |
|
38 |
} |
|
0 | 39 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/WrongParameterException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* This exception is throwed when a parameter of a function is wrong. |
|
5 |
* |
|
6 |
* 24/10/2008 |
|
7 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
8 |
*/ |
|
9 |
public class WrongParameterException extends Exception { |
|
10 |
private static final long serialVersionUID = -4312548276663417111L; |
|
11 |
|
|
12 |
public WrongParameterException(String msg) { |
|
13 |
super(msg); |
|
14 |
} |
|
15 |
} |
|
0 | 16 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.raster.cache.buffer.exception package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Exceptions which are thrown by a wrong buffer access</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
</p> |
|
14 |
|
|
15 |
</body> |
|
16 |
</html> |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/BufferInvalidException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* Excepci?n lanzada cuando se detecta que un buffer de raster es incorrecto. |
|
5 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
6 |
* |
|
7 |
*/ |
|
8 |
public class BufferInvalidException extends Exception{ |
|
9 |
private static final long serialVersionUID = -1566113755637911586L; |
|
10 |
|
|
11 |
public BufferInvalidException(String msg){ |
|
12 |
super(msg); |
|
13 |
} |
|
14 |
} |
|
0 | 15 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/BufferInvalidAccessException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* Excepci?n lanzada cuando se detecta un acceso a un tipo de datos incorrecto |
|
5 |
* en un RasterBuffer. |
|
6 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
7 |
* |
|
8 |
*/ |
|
9 |
public class BufferInvalidAccessException extends Exception{ |
|
10 |
|
|
11 |
private static final long serialVersionUID = -3065331336250589153L; |
|
12 |
|
|
13 |
public BufferInvalidAccessException(String msg){ |
|
14 |
super(msg); |
|
15 |
} |
|
16 |
} |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/ProcessInterruptedException.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.raster.cache.buffer.exception; |
|
23 |
|
|
24 |
import org.gvsig.tools.exception.BaseException; |
|
25 |
|
|
26 |
/** |
|
27 |
* Excepci?n lanzada cuando se interrumpe un proceso |
|
28 |
* |
|
29 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
30 |
*/ |
|
31 |
public class ProcessInterruptedException extends BaseException { |
|
32 |
private static final long serialVersionUID = 666908550965442025L; |
|
33 |
|
|
34 |
public ProcessInterruptedException(Throwable e){ |
|
35 |
super(e.getMessage(), e, "", 0); |
|
36 |
} |
|
37 |
|
|
38 |
public ProcessInterruptedException(String msg){ |
|
39 |
super(msg, "", 0); |
|
40 |
} |
|
41 |
} |
|
0 | 42 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/BandNotCompatibleException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* This exception is throwed when a selected band is not compatible with other or |
|
5 |
* with a databuffer. |
|
6 |
* |
|
7 |
* 24/10/2008 |
|
8 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
9 |
*/ |
|
10 |
public class BandNotCompatibleException extends Exception { |
|
11 |
private static final long serialVersionUID = -4312548276663417111L; |
|
12 |
|
|
13 |
public BandNotCompatibleException(String msg) { |
|
14 |
super(msg); |
|
15 |
} |
|
16 |
} |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/exception/OperationNotSupportedException.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.exception; |
|
2 |
|
|
3 |
/** |
|
4 |
* This exception is throwed when a selected operation is not compatible with |
|
5 |
* the buffer |
|
6 |
* |
|
7 |
* 24/10/2008 |
|
8 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
9 |
*/ |
|
10 |
public class OperationNotSupportedException extends Exception { |
|
11 |
private static final long serialVersionUID = -4312548276663417111L; |
|
12 |
|
|
13 |
public OperationNotSupportedException(String message, Throwable cause) { |
|
14 |
super(message, cause); |
|
15 |
} |
|
16 |
|
|
17 |
public OperationNotSupportedException(String msg) { |
|
18 |
super(msg); |
|
19 |
} |
|
20 |
} |
|
0 | 21 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.raster.cache.buffer package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Basic API to access a buffer of raster data</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
</p> |
|
14 |
|
|
15 |
</body> |
|
16 |
</html> |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/BufferInterpolation.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
|
4 |
import org.gvsig.raster.cache.buffer.task.IncrementableTask; |
|
5 |
|
|
6 |
/** |
|
7 |
* Interface implemented by a buffer interpolation object |
|
8 |
* |
|
9 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
10 |
*/ |
|
11 |
public interface BufferInterpolation extends IncrementableTask { |
|
12 |
public final static int INTERPOLATION_Undefined = 0; |
|
13 |
public final static int INTERPOLATION_NearestNeighbour = 1; |
|
14 |
public final static int INTERPOLATION_Bilinear = 2; |
|
15 |
public final static int INTERPOLATION_InverseDistance = 3; |
|
16 |
public final static int INTERPOLATION_Bicubic = 4; |
|
17 |
public final static int INTERPOLATION_BSpline = 5; |
|
18 |
|
|
19 |
/** |
|
20 |
* Get the supersampled buffer on a IRasterBuffer |
|
21 |
* @return |
|
22 |
* @throws ProcessInterruptedException |
|
23 |
*/ |
|
24 |
public Buffer getSupersampledScrolledNearestNeighbour(double[] superSampStep, int w, int h) throws ProcessInterruptedException; |
|
25 |
|
|
26 |
public Buffer getSupersampledScrolledBilinearInterpolation(double[] superSampStep, int w, int h) throws ProcessInterruptedException; |
|
27 |
|
|
28 |
/** |
|
29 |
* Ajusta el raster al ancho y alto solicitado por el vecino m?s cercano. Promedia el valor de dos |
|
30 |
* pixeles contiguos. |
|
31 |
* @param w Nuevo ancho |
|
32 |
* @param h Nuevo alto |
|
33 |
*/ |
|
34 |
public Buffer adjustRasterNearestNeighbourInterpolation(int w, int h) throws ProcessInterruptedException; |
|
35 |
|
|
36 |
/** |
|
37 |
* Ajusta el raster al ancho y alto solicitado ajustando con una interpolaci?n bilineal. Promedia |
|
38 |
* el valor de cuatro pixeles adyacentes. |
|
39 |
* <P> |
|
40 |
* Para cada pixel del raster A:(x, y) obtiene el B:(x + 1, y), C:(x, y + 1), D:(x + 1, y + 1) |
|
41 |
* Para cada valor del kernel se calcula un valor 'd' que es un peso dependiendo de su posici?n. |
|
42 |
* Este peso depende de la posici?n del pixel destino dentro del origen. La posici?n del pixel destino |
|
43 |
* en el origen es un valor decimal que puede ir de 0 a 1. Si est? muy pegado a la esquina superior |
|
44 |
* izquierda estar? cercano a 0 y si est? muy pegado a la esquina inferior derecha estar? cercano a 1. |
|
45 |
* Este valor est? representado por 'dx' y 'dy'. |
|
46 |
* </P> |
|
47 |
* <P> |
|
48 |
* Los pesos aplicados son a |
|
49 |
* <UL> |
|
50 |
* <LI>A (1-dx) * (1-dy)</LI> |
|
51 |
* <LI>B dx * (1-dy)</LI> |
|
52 |
* <LI>C (1-dx) * dy</LI> |
|
53 |
* <LI>D dx * dy</LI> |
|
54 |
* </UL> |
|
55 |
* La variable 'z' contiene el valor acumulado de cada peso por el valor del pixel. |
|
56 |
* La variable 'n' contiene el valor acumulado de los pesos de los cuatro pixeles. |
|
57 |
* El valor final del pixel ser? 'z/n', es decir un promedio del valor de los cuatro teniendo |
|
58 |
* en cuenta el peso de cada uno. |
|
59 |
* </P> |
|
60 |
* @param w Nuevo ancho del buffer de salida |
|
61 |
* @param h Nuevo alto del buffer de salida |
|
62 |
*/ |
|
63 |
public Buffer adjustRasterBilinearInterpolation(int w, int h) throws ProcessInterruptedException; |
|
64 |
|
|
65 |
/** |
|
66 |
* Ajusta el raster al ancho y alto solicitado ajustando con una interpolaci?n de distancia inversa. |
|
67 |
* Asigna el valor de un pixel en funci?n inversa de la distancia. |
|
68 |
* <P> |
|
69 |
* Para cada pixel del raster A:(x, y) obtiene el B:(x + 1, y), C:(x, y + 1), D:(x + 1, y + 1) |
|
70 |
* Para cada valor del kernel se calcula un valor 'd' que es un peso dependiendo de su posici?n. |
|
71 |
* Este peso ser? dependiente de la posici?n del pixel destino dentro del origen. La posici?n del pixel destino |
|
72 |
* en el origen es un valor decimal que puede ir de 0 a 1. Si est? muy pegado a la esquina superior |
|
73 |
* izquierda estar? cercano a 0 y si est? muy pegado a la esquina inferior derecha estar? cercano a 1. |
|
74 |
* Este valor est? representado por 'dx' y 'dy'. En este caso, y a diferencia del m?todo |
|
75 |
* bilinear el peso vendr? representado por la inversa de la distancia entre la posici?n |
|
76 |
* dentro del pixel y el origen del mismo. |
|
77 |
* </P> |
|
78 |
* <P> |
|
79 |
* Los pesos aplicados son a |
|
80 |
* <UL> |
|
81 |
* <LI>A 1 / sqrt((1-dx) * (1-dy))</LI> |
|
82 |
* <LI>B 1 / sqrt(dx * (1-dy))</LI> |
|
83 |
* <LI>C 1 / sqrt((1-dx) * dy)</LI> |
|
84 |
* <LI>D 1 / sqrt(dx * dy)</LI> |
|
85 |
* </UL> |
|
86 |
* La variable 'z' contiene el valor acumulado de cada peso por el valor del pixel. |
|
87 |
* La variable 'n' contiene el valor acumulado de los pesos de los cuatro pixeles. |
|
88 |
* El valor final del pixel ser? 'z/n', es decir un promedio del valor de los cuatro teniendo |
|
89 |
* en cuenta el peso de cada uno. |
|
90 |
* </P> |
|
91 |
* @param w Nuevo ancho del buffer de salida |
|
92 |
* @param h Nuevo alto del buffer de salida |
|
93 |
*/ |
|
94 |
public Buffer adjustRasterInverseDistanceInterpolation(int w, int h) throws ProcessInterruptedException; |
|
95 |
/** |
|
96 |
* Ajusta el raster al ancho y alto solicitado ajustando con una interpolaci?n BSpline. Promedia |
|
97 |
* el valor de cuatro pixeles adyacentes. |
|
98 |
* @param w Nuevo ancho |
|
99 |
* @param h Nuevo alto |
|
100 |
*/ |
|
101 |
public Buffer adjustRasterBSplineInterpolation(int w, int h) throws ProcessInterruptedException; |
|
102 |
|
|
103 |
/** |
|
104 |
* Ajusta el raster al ancho y alto solicitado ajustando con una interpolaci?n de spline bicubica. |
|
105 |
* @param w Nuevo ancho |
|
106 |
* @param h Nuevo alto |
|
107 |
*/ |
|
108 |
public Buffer adjustRasterBicubicSplineInterpolation(int w, int h) throws ProcessInterruptedException; |
|
109 |
|
|
110 |
/** |
|
111 |
* Obtiene el porcentaje del proceso de interpolacion |
|
112 |
* @return |
|
113 |
*/ |
|
114 |
public int getPercent(); |
|
115 |
} |
|
0 | 116 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/BufferCacheLocator.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.raster.cache.buffer; |
|
23 |
|
|
24 |
import org.gvsig.tools.locator.BaseLocator; |
|
25 |
import org.gvsig.tools.locator.Locator; |
|
26 |
import org.gvsig.tools.locator.LocatorException; |
|
27 |
|
|
28 |
/** |
|
29 |
* This locator is the entry point for the Raster library, providing |
|
30 |
* access to all Raster services through the {@link BufferCacheManager} |
|
31 |
* . |
|
32 |
* |
|
33 |
* @author gvSIG team |
|
34 |
* @version $Id$ |
|
35 |
*/ |
|
36 |
public class BufferCacheLocator extends BaseLocator { |
|
37 |
public static final String MANAGER_NAME = "BufferCache.manager"; |
|
38 |
public static final String MANAGER_DESCRIPTION = "BufferCache Manager"; |
|
39 |
private static final String LOCATOR_NAME = "BufferCache.locator"; |
|
40 |
private static final BufferCacheLocator INSTANCE = new BufferCacheLocator(); |
|
41 |
|
|
42 |
/** |
|
43 |
* Return the singleton instance. |
|
44 |
* |
|
45 |
* @return the singleton instance |
|
46 |
*/ |
|
47 |
public static BufferCacheLocator getInstance() { |
|
48 |
return INSTANCE; |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* Return the Locator's name. |
|
53 |
* |
|
54 |
* @return a String with the Locator's name |
|
55 |
*/ |
|
56 |
public final String getLocatorName() { |
|
57 |
return LOCATOR_NAME; |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* Return a reference to the RasterManager. |
|
62 |
* |
|
63 |
* @return a reference to the RasterManager |
|
64 |
* @throws LocatorException |
|
65 |
* if there is no access to the class or the class cannot be |
|
66 |
* instantiated |
|
67 |
* @see Locator#get(String) |
|
68 |
*/ |
|
69 |
public static BufferCacheManager getManager() throws LocatorException { |
|
70 |
return (BufferCacheManager) getInstance().get(MANAGER_NAME); |
|
71 |
} |
|
72 |
|
|
73 |
/** |
|
74 |
* Registers the Class implementing the RasterManager interface. |
|
75 |
* |
|
76 |
* @param clazz |
|
77 |
* implementing the RasterManager interface |
|
78 |
*/ |
|
79 |
public static void registerManager( |
|
80 |
Class<? extends BufferCacheManager> clazz) { |
|
81 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
82 |
} |
|
83 |
|
|
84 |
} |
|
0 | 85 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/task/BaseIncrementableTask.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.task; |
|
2 |
|
|
3 |
/** |
|
4 |
* Base class for incrementable tasks |
|
5 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
6 |
*/ |
|
7 |
public interface BaseIncrementableTask { |
|
8 |
|
|
9 |
/** |
|
10 |
* Gets the increment |
|
11 |
* @return int |
|
12 |
*/ |
|
13 |
public int getPercent(); |
|
14 |
|
|
15 |
/** |
|
16 |
* Sets the increment of this task |
|
17 |
*/ |
|
18 |
public void setPercent(int value); |
|
19 |
} |
|
0 | 20 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/task/CancelEvent.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.task; |
|
2 |
|
|
3 |
import java.util.EventObject; |
|
4 |
|
|
5 |
/** |
|
6 |
* Evento de cancelaci?n a los procesos registrados en RasterTaskQueue. |
|
7 |
* |
|
8 |
* @version 17/09/2007 |
|
9 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
10 |
* |
|
11 |
*/ |
|
12 |
public class CancelEvent extends EventObject { |
|
13 |
|
|
14 |
private static final long serialVersionUID = 7564626429497930401L; |
|
15 |
|
|
16 |
/** |
|
17 |
* Construye un CancelEvent |
|
18 |
* @param source |
|
19 |
*/ |
|
20 |
public CancelEvent(Object source) { |
|
21 |
super(source); |
|
22 |
} |
|
23 |
} |
|
0 | 24 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/task/IncrementableTask.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.task; |
|
2 |
|
|
3 |
/** |
|
4 |
* This interface defines methods for common tasks |
|
5 |
* |
|
6 |
* @version 07/05/2007 |
|
7 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
8 |
* |
|
9 |
*/ |
|
10 |
public interface IncrementableTask extends BaseIncrementableTask { |
|
11 |
/** |
|
12 |
* Devuelve el contenido del log del IncrementableTask |
|
13 |
* @return String |
|
14 |
*/ |
|
15 |
public String getLog(); |
|
16 |
|
|
17 |
/** |
|
18 |
* <p>Determines if this process can be canceled.</p> |
|
19 |
* |
|
20 |
* @return <code>true</code> if this process can be canceled, otherwise <code>false</code> |
|
21 |
*/ |
|
22 |
public boolean isCancelable(); |
|
23 |
|
|
24 |
/** |
|
25 |
* <p>Determines if this process can be paused.</p> |
|
26 |
* |
|
27 |
* @return <code>true</code> if this process can be paused, otherwise <code>false</code> |
|
28 |
*/ |
|
29 |
public boolean isPausable(); |
|
30 |
} |
|
0 | 31 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/task/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.raster.cache.buffer.task package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Buffer tasks</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
</p> |
|
14 |
|
|
15 |
</body> |
|
16 |
</html> |
|
0 | 17 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/task/TaskEventManager.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.task; |
|
2 |
|
|
3 |
import java.util.EventObject; |
|
4 |
|
|
5 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
|
6 |
|
|
7 |
|
|
8 |
/** |
|
9 |
* Service to send events to a task. To register a new event you have to |
|
10 |
* use the RasterManager |
|
11 |
* <code>TaskEventManager task = manager.createRasterTask(this);</code> |
|
12 |
* You can send events to the task |
|
13 |
* <code>task.sendEvent(new CancelEvent(this));</code> |
|
14 |
* If you want recover a registered task to send it a event you'll have |
|
15 |
* to use the RasterManager again. To get the task it will use the current |
|
16 |
* thread ID. |
|
17 |
* <code>TaskEventManager task = manager.getRasterTask()</code> |
|
18 |
* |
|
19 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
20 |
*/ |
|
21 |
public interface TaskEventManager { |
|
22 |
|
|
23 |
/** |
|
24 |
* Removes this task from the repository |
|
25 |
* @param |
|
26 |
*/ |
|
27 |
public void removeTask(); |
|
28 |
|
|
29 |
/** |
|
30 |
* Sets a event. |
|
31 |
* @param ev EventObject |
|
32 |
*/ |
|
33 |
public void setEvent(EventObject ev); |
|
34 |
|
|
35 |
/** |
|
36 |
* Obtiene el evento |
|
37 |
* @return EventObject |
|
38 |
*/ |
|
39 |
public EventObject getEvent(); |
|
40 |
|
|
41 |
/** |
|
42 |
* Gesti?n de las se?ales. Este m?todo define las acciones por defecto para |
|
43 |
* cada se?al. No es necesario utilizar estas. Se puede en cada caso, hacer un m?todo |
|
44 |
* manageEvent en el que se gestione las acciones concretas de una se?al. |
|
45 |
* |
|
46 |
* @param ev Evento a gestionar |
|
47 |
*/ |
|
48 |
public void manageEvent(EventObject ev) throws ProcessInterruptedException; |
|
49 |
} |
|
0 | 50 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/task/Task.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer.task; |
|
2 |
|
|
3 |
import java.util.EventObject; |
|
4 |
/** |
|
5 |
* A process have to contain a {@link Task} object. A process should be |
|
6 |
* registered when this starts and removed from the register when this finishes or |
|
7 |
* is canceled. This process has to do these actions. |
|
8 |
* |
|
9 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
10 |
*/ |
|
11 |
public interface Task { |
|
12 |
|
|
13 |
/** |
|
14 |
* Asigna el evento |
|
15 |
* @param ev EventObject |
|
16 |
*/ |
|
17 |
public void setEvent(EventObject ev); |
|
18 |
|
|
19 |
/** |
|
20 |
* Obtiene el evento |
|
21 |
* @return EventObject |
|
22 |
*/ |
|
23 |
public EventObject getEvent(); |
|
24 |
|
|
25 |
/** |
|
26 |
* Obtiene el identificador ?nico del proceso. |
|
27 |
* @return Identificador del proceso |
|
28 |
*/ |
|
29 |
public String getID(); |
|
30 |
|
|
31 |
/** |
|
32 |
* Gesti?n de las se?ales. Este m?todo define las acciones por defecto para |
|
33 |
* cada se?al. No es necesario utilizar estas. Se puede en cada caso, hacer un m?todo |
|
34 |
* manageEvent en el que se gestione las acciones concretas de una se?al. |
|
35 |
* |
|
36 |
* @param ev Evento a gestionar |
|
37 |
*/ |
|
38 |
public void manageEvent(EventObject ev) throws InterruptedException; |
|
39 |
} |
|
0 | 40 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/BufferCacheLibrary.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.raster.cache.buffer; |
|
23 |
|
|
24 |
import org.gvsig.tools.library.AbstractLibrary; |
|
25 |
import org.gvsig.tools.library.LibraryException; |
|
26 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
27 |
|
|
28 |
|
|
29 |
/** |
|
30 |
* |
|
31 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
32 |
*/ |
|
33 |
public class BufferCacheLibrary extends AbstractLibrary { |
|
34 |
|
|
35 |
public BufferCacheLibrary() { |
|
36 |
registerAsAPI(BufferCacheLibrary.class); |
|
37 |
} |
|
38 |
|
|
39 |
@Override |
|
40 |
protected void doInitialize() throws LibraryException { |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
protected void doPostInitialize() throws LibraryException { |
|
45 |
BufferCacheManager manager = BufferCacheLocator.getManager(); |
|
46 |
if (manager == null) { |
|
47 |
throw new ReferenceNotRegisteredException( |
|
48 |
BufferCacheLocator.MANAGER_NAME, BufferCacheLocator |
|
49 |
.getInstance()); |
|
50 |
} |
|
51 |
} |
|
52 |
} |
|
0 | 53 |
org.gvsig.raster.cache/tags/org.gvsig.raster.cache-2.2.74/org.gvsig.raster.cache.lib.api/src/main/java/org/gvsig/raster/cache/buffer/BufferDataSource.java | ||
---|---|---|
1 |
package org.gvsig.raster.cache.buffer; |
|
2 |
|
|
3 |
import java.io.IOException; |
|
4 |
|
|
5 |
import org.gvsig.raster.cache.buffer.exception.OperationNotSupportedException; |
|
6 |
import org.gvsig.raster.cache.buffer.exception.ProcessInterruptedException; |
|
7 |
|
|
8 |
|
|
9 |
/** |
|
10 |
* Data Server for read only buffers. |
|
11 |
* 02/11/2008 |
|
12 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
13 |
*/ |
|
14 |
public interface BufferDataSource { |
|
15 |
/** |
|
16 |
* Get the path to image file |
|
17 |
* @return |
|
18 |
*/ |
|
19 |
public String[] getPath(); |
|
20 |
|
|
21 |
/** |
|
22 |
* Set the path to image file |
|
23 |
* @param path |
|
24 |
* path to the file |
|
25 |
*/ |
Also available in: Unified diff