root / trunk / libraries / libRaster / src / org / gvsig / raster / buffer / IQueryableRaster.java @ 11074
History | View | Annotate | Download (8.93 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2006 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 |
package org.gvsig.raster.buffer; |
20 |
|
21 |
import org.gvsig.raster.dataset.IBuffer; |
22 |
import org.gvsig.raster.dataset.RasterMultiDataset; |
23 |
import org.gvsig.raster.dataset.properties.DatasetPalette; |
24 |
import org.gvsig.raster.shared.Extent; |
25 |
|
26 |
|
27 |
/**
|
28 |
* Interfaz que deben implementar las clases que sirven datos y tienen posibilidad
|
29 |
* de consulta. Tipicamente en gvSIG es implementado por DataSource que ofrecer?
|
30 |
* sus datos a trav?s de un RasterBuffer y su interfaz IBuffer.
|
31 |
*
|
32 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
33 |
*
|
34 |
*/
|
35 |
public interface IQueryableRaster { |
36 |
public final static int INTERPOLATION_Undefined = 0; |
37 |
public final static int INTERPOLATION_NearestNeighbour = 1; |
38 |
public final static int INTERPOLATION_Bilinear = 2; |
39 |
public final static int INTERPOLATION_InverseDistance = 3; |
40 |
public final static int INTERPOLATION_BicubicSpline = 4; |
41 |
public final static int INTERPOLATION_BSpline = 5; |
42 |
|
43 |
/**
|
44 |
* Obtiene el ancho de la imagen
|
45 |
* @return Ancho en pixeles de la imagen
|
46 |
*/
|
47 |
public int getWidth(); |
48 |
|
49 |
/**
|
50 |
* Obtiene el alto de la imagen
|
51 |
* @return Alto en pixeles de la imagen
|
52 |
*/
|
53 |
public int getHeight(); |
54 |
|
55 |
/**
|
56 |
* Tama?o de celda en X
|
57 |
* @return
|
58 |
*/
|
59 |
public double getXCellSize(); |
60 |
|
61 |
/**
|
62 |
* Tama?o de celda en Y
|
63 |
* @return
|
64 |
*/
|
65 |
public double getYCellSize(); |
66 |
|
67 |
/**
|
68 |
* Asigna el ?rea de interes en coordenadas del mundo real. Si las coordenadas exceden del tama?o de la imagen
|
69 |
* estas coordenadas son ajustadas el extent.
|
70 |
* @param x Coordenada X, esquina superior izquierda
|
71 |
* @param y Coordenada Y, esquina superior izquierda
|
72 |
* @param w Ancho del ?rea
|
73 |
* @param h Alto del ?rea
|
74 |
* @param adjustToExtent Flag que dice si el extent solicitado debe ajustarse al extent del raster o no.
|
75 |
* @throws ArrayIndexOutOfBoundsException
|
76 |
*/
|
77 |
public void setAreaOfInterest(double x, double y, double w, double h, boolean adjustToExtent) throws ArrayIndexOutOfBoundsException; |
78 |
|
79 |
/**
|
80 |
* Asigna el ?rea de interes en coordenadas pixel. Si las coordenadas exceden del tama?o de la imagen
|
81 |
* lanza una excepci?n.
|
82 |
* @param x Coordenada X, esquina superior izquierda
|
83 |
* @param y Coordenada Y, esquina superior izquierda
|
84 |
* @param w Ancho del ?rea
|
85 |
* @param h Alto del ?rea
|
86 |
* @throws ArrayIndexOutOfBoundsException
|
87 |
*/
|
88 |
public void setAreaOfInterest(int x, int y, int w, int h) throws ArrayIndexOutOfBoundsException; |
89 |
|
90 |
/**
|
91 |
* Asigna el ?rea de inter?s a toda la extensi?n del raster.
|
92 |
*/
|
93 |
public void setAreaOfInterest(); |
94 |
|
95 |
/**
|
96 |
* Asigna el ?rea de interes en coordenadas pixel. Esta operaci?n cargar? un RasterBuffer con los datos solicitados por
|
97 |
* lo que, si al acabar hacemos getRasterBuf obtendremos la matriz de datos. Si las coordenadas exceden del tama?o
|
98 |
* de la imagen lanza una excepci?n.
|
99 |
* @param x Coordenada X, esquina superior izquierda
|
100 |
* @param y Coordenada Y, esquina superior izquierda
|
101 |
* @param w Ancho del ?rea
|
102 |
* @param h Alto del ?rea
|
103 |
* @param bufWidth Ancho del buffer
|
104 |
* @param bufHeight Alto del buffer
|
105 |
* @throws ArrayIndexOutOfBoundsException
|
106 |
*/
|
107 |
public void setAreaOfInterest(int x, int y, int w, int h, int bufWidth, int bufHeight) throws ArrayIndexOutOfBoundsException; |
108 |
|
109 |
/**
|
110 |
* Asigna el ?rea de interes en coordenadas del mundo real. Si las coordenadas exceden del tama?o de la imagen
|
111 |
* estas coordenadas son ajustadas el extent.
|
112 |
* @param x Coordenada X, esquina superior izquierda
|
113 |
* @param y Coordenada Y, esquina superior izquierda
|
114 |
* @param w Ancho del ?rea
|
115 |
* @param h Alto del ?rea
|
116 |
* @param bufWidth Ancho del buffer
|
117 |
* @param bufHeight Alto del buffer
|
118 |
* @param adjustToExtent Flag que dice si el extent solicitado debe ajustarse al extent del raster o no.
|
119 |
* @return En caso de que el buffer sea mayor que el tama?o seleccionado de raster se produce supersampleo. La funci?n devuelve
|
120 |
* un array de dos elementos que representan el desplazamiento en pixels de X e Y de la esquina superior izquierda.
|
121 |
* @throws ArrayIndexOutOfBoundsException
|
122 |
*/
|
123 |
public int[] setAreaOfInterest(double minX, double minY, double maxX, double maxY, int bufWidth, int bufHeight, boolean adjustToExtent) throws ArrayIndexOutOfBoundsException; |
124 |
|
125 |
/**
|
126 |
* Obtiene un buffer desde la posici?n x,y en pixeles de ancho w y alto h
|
127 |
* @param x Coordenada x de la esquina superior izquierda
|
128 |
* @param y Coordenada y de la esquina superior izquierda
|
129 |
* @param w Ancho del grid
|
130 |
* @param h Alto del grid
|
131 |
* @return Buffer de datos
|
132 |
*/
|
133 |
public RasterBuffer getData(int x, int y, int w, int h); |
134 |
|
135 |
/**
|
136 |
* Devuelve el tipo de datos del raster
|
137 |
* @see java.awt.image.DataBuffer
|
138 |
*/
|
139 |
public int getDataType(); |
140 |
|
141 |
/**
|
142 |
* Asigna tipo de datos del raster
|
143 |
* @see java.awt.image.DataBuffer
|
144 |
*/
|
145 |
public void setDataType(int dt); |
146 |
|
147 |
/**
|
148 |
* Devuelve true si la celda contiene un valor de NODATA
|
149 |
* @param x coordenada X
|
150 |
* @param y coordenada Y
|
151 |
* @return
|
152 |
*/
|
153 |
public boolean isNoData(int x, int y, int band); |
154 |
|
155 |
/**
|
156 |
* Obtiene el n?mero de bandas
|
157 |
* @return N?mero de bandas
|
158 |
*/
|
159 |
public int getBandCount(); |
160 |
|
161 |
/**
|
162 |
* Obtiene el buffer de datos del grid
|
163 |
* @return RasterBuf
|
164 |
*/
|
165 |
public IBuffer getRasterBuf();
|
166 |
|
167 |
/**
|
168 |
* Para este GeoRasterFile asigna que bandas se pintaran
|
169 |
* sobre el RasterBuf cuando se haga un update. Cada posici?n del vector es una banda
|
170 |
* del rasterBuf y el contenido de esa posici?n es la banda de la imagen que se dibujar?
|
171 |
* sobre ese RasterBuf.
|
172 |
* @param drawableBands Array con las bandas a dibujar.
|
173 |
* @return array con tantos elementos como bandas a dibujar. El valor contenido es el fichero del
|
174 |
* dataset multifichero al que corresponde la banda.
|
175 |
*/
|
176 |
public int[] addDrawableBands(int[] drawableBands); |
177 |
|
178 |
/**
|
179 |
* Para este GeoRasterFile asigna que bandas se pintaran
|
180 |
* sobre el RasterBuf cuando se haga un update. Cada posici?n del vector es una banda
|
181 |
* del rasterBuf y el contenido de esa posici?n es la banda de la imagen que se dibujar?
|
182 |
* sobre ese RasterBuf. Esta llamada asigna todas las bandas dibujables en su orden natural.
|
183 |
* @return array con tantos elementos como bandas a dibujar. El valor contenido es el fichero del
|
184 |
* dataset multifichero al que corresponde la banda.
|
185 |
*/
|
186 |
public int[] setAllDrawableBands(); |
187 |
|
188 |
/**
|
189 |
* Obtiene el array que contiene el orden de bandas. Cada posici?n del vector es una banda
|
190 |
* del rasterBuf y el contenido de esa posici?n es la banda de la imagen que se dibujar?
|
191 |
* sobre ese RasterBuf.
|
192 |
* @return Array de enteros con el orden de las badas
|
193 |
*/
|
194 |
public int[] getDrawableBands(); |
195 |
|
196 |
/**
|
197 |
* Obtiene el extent de la fuente de datos
|
198 |
* @return Extent
|
199 |
*/
|
200 |
public Extent getExtent();
|
201 |
|
202 |
/**
|
203 |
* Obtiene el extent correspondiente a los datos cargados en el buffer
|
204 |
* @return Extent
|
205 |
*/
|
206 |
public Extent getDataExtent();
|
207 |
|
208 |
/**
|
209 |
* Obtiene las coordenadas del fichero worldFile (o cabecera del raster) asociado
|
210 |
* o el RMF en caso de que existan. Si la imagen no est? georreferenciada tendr?
|
211 |
* las coordenadas pixel de la misma
|
212 |
* @return Array de seis valores:
|
213 |
* <TABLE BORDER="1">
|
214 |
* <TR><TD><B>0:</B></TD><TD>Valor X de la esquina superior izquierda.</TD></TR>
|
215 |
* <TR><TD><B>1:</B></TD><TD>Tama?o de pixel en X.</TD></TR>
|
216 |
* <TR><TD><B>2:</B></TD><TD>Shearing en X.</TD></TR>
|
217 |
* <TR><TD><B>3:</B></TD><TD>Valor Y de la esquina superior izquierda.</TD></TR>
|
218 |
* <TR><TD><B>4:</B></TD><TD>Shearing en Y.</TD></TR>
|
219 |
* <TR><TD><B>5:</B></TD><TD>Tama?o de pixel en Y.</TD></TR>
|
220 |
* </TABLE>
|
221 |
*/
|
222 |
public double[] getCoordsGeoTransformFile(); |
223 |
|
224 |
/**
|
225 |
* Obtiene el extent de la ?ltima selecci?n hecha con alguna de las llamadas
|
226 |
* setAreaOfInterest. Este extent es devuelto en coordenadas reales con las transformaciones
|
227 |
* que se hayan aplicado sobre el/los dataset.
|
228 |
* @return Extent Coordenadas reales que representan el ?ltimo ?rea de datos
|
229 |
* solicitada.
|
230 |
*/
|
231 |
public Extent getLastSelectedView();
|
232 |
|
233 |
/**
|
234 |
* Obtiene la estructura que contiene la lista de ficheros del Grid
|
235 |
* @return GeoRasterMultiFile
|
236 |
*/
|
237 |
public RasterMultiDataset getGeoRasterMultiFile();
|
238 |
|
239 |
/**
|
240 |
* Obtiene la lista de paletas asociadas a las bandas cargadas en el DataSource
|
241 |
* @return Lista con las paletas o null si no hay ninguna asocida. Un nulo en una
|
242 |
* posici?n del array tambi?n indicar? que para esa banda no hay paletas asociadas.
|
243 |
*/
|
244 |
public DatasetPalette[] getPalettes(); |
245 |
|
246 |
} |