root / tags / v1_0_2_Build_903+3D / libraries / libFMap / src / com / iver / cit / gvsig / fmap / drivers / RasterDriver.java @ 10722
History | View | Annotate | Download (6.69 KB)
1 | 1100 | fjp | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | 2183 | fernando | *
|
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 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | 302 | fernando | package com.iver.cit.gvsig.fmap.drivers; |
42 | |||
43 | 659 | luisw | import java.awt.Dimension; |
44 | 671 | luisw | import java.awt.Graphics2D; |
45 | 659 | luisw | import java.awt.Image; |
46 | 567 | luisw | import java.awt.geom.Rectangle2D; |
47 | 671 | luisw | import java.awt.image.BufferedImage; |
48 | 358 | fernando | import java.io.File; |
49 | import java.io.IOException; |
||
50 | 1680 | luisw | import java.util.ArrayList; |
51 | 515 | luisw | |
52 | 659 | luisw | import org.cresques.cts.ICoordTrans; |
53 | 5979 | nacho | import org.cresques.filter.RasterFilterStack; |
54 | 2183 | fernando | import org.cresques.io.GeoRasterFile; |
55 | 9056 | nacho | import org.cresques.io.data.Grid; |
56 | 10195 | nacho | import org.cresques.io.data.RasterBuf; |
57 | import org.cresques.px.Extent; |
||
58 | 659 | luisw | |
59 | 567 | luisw | import com.hardcode.driverManager.Driver; |
60 | 671 | luisw | import com.iver.cit.gvsig.fmap.ViewPort; |
61 | 8765 | jjdelcerro | import com.iver.cit.gvsig.fmap.core.ISymbol; |
62 | 540 | luisw | |
63 | 567 | luisw | public interface RasterDriver extends Driver { |
64 | 10195 | nacho | |
65 | /**
|
||
66 | * Set data buffer to create a memory raster driver
|
||
67 | * @param buf data buffer
|
||
68 | */
|
||
69 | public void setBuffer(RasterBuf buf); |
||
70 | |||
71 | /**
|
||
72 | * Set extent to create a memory raster driver
|
||
73 | * @param ext Extent
|
||
74 | */
|
||
75 | public void setExtent(Extent ext); |
||
76 | |||
77 | 2183 | fernando | /**
|
78 | * Define los tipos de fichero que puede leer el driver. Si devuelve true,
|
||
79 | * el fichero est? aceptado (es de los que el driver puede leer), si
|
||
80 | * devuelve false es porque no lo puede leer.
|
||
81 | */
|
||
82 | 567 | luisw | public boolean fileAccepted(File fName); |
83 | |||
84 | public void open(File f) throws IOException; |
||
85 | 540 | luisw | |
86 | 567 | luisw | public void initialize() throws IOException; |
87 | |||
88 | public void close() throws IOException; |
||
89 | |||
90 | 2183 | fernando | /**
|
91 | * Obtiene la extensi?n en coordenadas del mundo real que ocupa este raster
|
||
92 | */
|
||
93 | 567 | luisw | public Rectangle2D getFullExtent(); |
94 | 2183 | fernando | /**
|
95 | * Obtiene el n?mero de bandas del raster
|
||
96 | */
|
||
97 | 567 | luisw | public int getNumBands(); |
98 | 1455 | luisw | |
99 | public int getTransparency(); |
||
100 | |||
101 | public void setTransparency(int trans); |
||
102 | 302 | fernando | |
103 | /**
|
||
104 | 8765 | jjdelcerro | * @see com.iver.cit.gvsig.fmap.layers.LayerOperations#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, ISymbol)
|
105 | 671 | luisw | */
|
106 | public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort) |
||
107 | throws DriverIOException;
|
||
108 | |||
109 | /**
|
||
110 | 302 | fernando | * Obtiene el valor que el raster tiene en la posici?n x, y del bitmap
|
111 | * @see com.iver.cit.gvsig.fmap.layers.RasterComplexOperations#getValueByCoords(int, int, int)
|
||
112 | 567 | luisw | * /
|
113 | 302 | fernando | byte[] getPixel(int x, int y, byte[] dArray);
|
114 | |||
115 | 567 | luisw | / **
|
116 | 302 | fernando | * Obtiene el valor que el raster tiene en la posici?n x, y del bitmap
|
117 | * @see com.iver.cit.gvsig.fmap.layers.RasterComplexOperations#getValueByCoords(int, int, int)
|
||
118 | 567 | luisw | * /
|
119 | 302 | fernando | int[] getPixel(int x, int y, int[] dArray);
|
120 | |||
121 | /**
|
||
122 | * Obtiene el valor que el raster tiene en la posici?n x, y del bitmap
|
||
123 | * @see com.iver.cit.gvsig.fmap.layers.RasterComplexOperations#getValueByCoords(int, int, int)
|
||
124 | 518 | luisw | * /
|
125 | 302 | fernando | float[] getPixel(int x, int y, float[] dArray);
|
126 | |||
127 | /**
|
||
128 | * Obtiene el valor que el raster tiene en la posici?n x, y del mundo real para la banda que se pasa como par?metro
|
||
129 | * @see com.iver.cit.gvsig.fmap.layers.RasterComplexOperations#getValueByCoords(int, int, int)
|
||
130 | 518 | luisw | * /
|
131 | double[] getPixel(int x, int y, double[] dArray);
|
||
132 | */
|
||
133 | |||
134 | /**
|
||
135 | * Devuelve el tipo de datos del raster
|
||
136 | * @see java.awt.image.DataBuffer
|
||
137 | 302 | fernando | */
|
138 | 567 | luisw | public int getRasterDataType(); |
139 | 302 | fernando | |
140 | 2183 | fernando | /**
|
141 | * Obtiene una muestra del pixel que se pasa como par?metro en la banda que se pasa como par?metro
|
||
142 | */
|
||
143 | 567 | luisw | public Object getData(int x, int y, int band); |
144 | 302 | fernando | |
145 | 2183 | fernando | /**
|
146 | * Obtiene una muestra del pixel que se pasa como par?metro en la banda que se pasa como par?metro
|
||
147 | */
|
||
148 | 567 | luisw | public int getDataAsInt(int x, int y, int band); |
149 | 554 | luisw | |
150 | 2183 | fernando | /**
|
151 | * Obtiene una muestra del pixel que se pasa como par?metro en la banda que se pasa como par?metro
|
||
152 | */
|
||
153 | 567 | luisw | public byte getDataAsByte(int x, int y, int band); |
154 | 302 | fernando | |
155 | 2183 | fernando | /**
|
156 | * Obtiene una muestra del pixel que se pasa como par?metro en la banda que se pasa como par?metro
|
||
157 | */
|
||
158 | 567 | luisw | public float getDataAsFloat(int x, int y, int band); |
159 | 302 | fernando | |
160 | 2183 | fernando | /**
|
161 | * Obtiene una muestra el pixel que se pasa como par?metro en la banda que se pasa como par?metro
|
||
162 | */
|
||
163 | 567 | luisw | public double getDataAsDouble(int x, int y, int band); |
164 | 659 | luisw | |
165 | /**
|
||
166 | * Obtiene una imagen de tama?o especificado, de la zona (en
|
||
167 | * coordenadas de usuario) que se le pide.
|
||
168 | * @param size Tama?o (en p?xeles de im?gen).
|
||
169 | * @param userSize Zona especificada (en coordenadas de usuario).
|
||
170 | * @param rp Reproyecci?n.
|
||
171 | * @return La imagen.
|
||
172 | */
|
||
173 | public Image getImage(Dimension size, Rectangle2D userSize, ICoordTrans rp); |
||
174 | 1680 | luisw | |
175 | 2183 | fernando | /**
|
176 | * Obtiene un array con atributos de la imagen
|
||
177 | * @return Lista de atributos
|
||
178 | */
|
||
179 | 1680 | luisw | public ArrayList getAttributes(); |
180 | 2183 | fernando | |
181 | /**
|
||
182 | * Obtiene una banda
|
||
183 | * @param flag banda a recuperar
|
||
184 | */
|
||
185 | public int getBand(int flag); |
||
186 | |||
187 | /**
|
||
188 | * Devuelve la posici?n del fichero para la banda especificada.
|
||
189 | * @param flag banda.
|
||
190 | * @return posici?n del fichero
|
||
191 | */
|
||
192 | public int getPosFile(int flag); |
||
193 | 659 | luisw | |
194 | 2183 | fernando | |
195 | /**
|
||
196 | * Activa o desactiva la transparencia
|
||
197 | * @param t true activa la transparencia y false la desactiva
|
||
198 | */
|
||
199 | public void setTransparency(boolean t); |
||
200 | |||
201 | /**
|
||
202 | * Asocia un colorBand al rojo, verde o azul.
|
||
203 | * @param flag cual (o cuales) de las bandas.
|
||
204 | * @param nBand que colorBand
|
||
205 | */
|
||
206 | public void setBand(int flag, int nBand); |
||
207 | |||
208 | /**
|
||
209 | * Obtiene la pila de filtros
|
||
210 | * @return Pila de filtros
|
||
211 | */
|
||
212 | public RasterFilterStack getFilterStack();
|
||
213 | |||
214 | 2623 | nacho | /**
|
215 | * Asigna la pila de filtros
|
||
216 | * @param pila de filtros
|
||
217 | */
|
||
218 | public void setFilterStack(RasterFilterStack stack); |
||
219 | 2183 | fernando | |
220 | public GeoRasterFile [] getFiles(); |
||
221 | |||
222 | /**
|
||
223 | * Asigna un fichero al PxRaster
|
||
224 | * @param fileName Nombre del fichero
|
||
225 | */
|
||
226 | public void addFile(String fileName); |
||
227 | |||
228 | /**
|
||
229 | * Elimina un fichero al PxRaster
|
||
230 | * @param fileName Nombre del fichero
|
||
231 | */
|
||
232 | public void delFile(String fileName); |
||
233 | 2322 | igbrotru | |
234 | /**
|
||
235 | * Obtiene el valor del pixel del Image en la posici?n x,y
|
||
236 | * @param x Posici?n x
|
||
237 | * @param y Posici?n y
|
||
238 | * @return valor de pixel
|
||
239 | */
|
||
240 | 2347 | igbrotru | public int[] getPixel(double wcx, double wcy); |
241 | 9056 | nacho | |
242 | 6037 | nacho | /**
|
243 | 9056 | nacho | * Obtiene el grid asociado
|
244 | * @return grid
|
||
245 | 6037 | nacho | */
|
246 | 9056 | nacho | public Grid getGrid();
|
247 | 3084 | nacho | |
248 | 2183 | fernando | } |