Statistics
| Revision:

root / trunk / extensions / extRasterTools-SE / src / org / gvsig / fmap / drivers / GenericRasterDriver.java @ 11173

History | View | Annotate | Download (5.71 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
* 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
package org.gvsig.fmap.drivers;
42

    
43
import java.awt.Dimension;
44
import java.awt.Graphics2D;
45
import java.awt.Image;
46
import java.awt.geom.Rectangle2D;
47
import java.awt.image.BufferedImage;
48
import java.io.File;
49
import java.io.IOException;
50
import java.util.ArrayList;
51

    
52
import org.cresques.cts.ICoordTrans;
53
import org.gvsig.raster.buffer.BufferFactory;
54
import org.gvsig.raster.grid.render.Rendering;
55

    
56
import com.hardcode.driverManager.Driver;
57
import com.iver.cit.gvsig.fmap.ViewPort;
58
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol;
59
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
60

    
61

    
62
public interface GenericRasterDriver extends Driver {
63
   /**
64
    * Define los tipos de fichero que puede leer el driver. Si devuelve true,
65
    * el fichero est? aceptado (es de los que el driver puede leer), si
66
    * devuelve false es porque no lo puede leer.
67
    */
68
        public boolean fileAccepted(File fName);
69
        
70
        public void open(File f) throws IOException;
71

    
72
        public void initialize() throws IOException;
73

    
74
        public void close() throws IOException;
75
        
76
        /**
77
         * Asigna los par?metros para la carga de la capa
78
         * @param param Par?metros.
79
         */
80
        public void setLoadParams(Object param);
81

    
82
   /**
83
    * Obtiene la extensi?n en coordenadas del mundo real que ocupa este raster 
84
    */
85
        public Rectangle2D getFullExtent();
86
   /**
87
    * Obtiene el n?mero de bandas del raster 
88
    */
89
        public int getNumBands();
90
        
91
        public int getTransparency();
92
        
93
        public void setTransparency(int trans);
94

    
95
        /**
96
         * @see com.iver.cit.gvsig.fmap.layers.LayerOperations#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, ISymbol)
97
         */
98
        public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort)
99
                        throws DriverIOException;
100
        
101
        /**
102
         * Devuelve el tipo de datos del raster
103
         * @see java.awt.image.DataBuffer
104
         */
105
        public int getRasterDataType();
106

    
107
   /**
108
    * Obtiene una muestra del pixel que se pasa como par?metro en la banda que se pasa como par?metro 
109
    */
110
        public Object getData(int x, int y, int band);
111

    
112
   /**
113
    * Obtiene una muestra del pixel que se pasa como par?metro en la banda que se pasa como par?metro 
114
    */
115
        public int getDataAsInt(int x, int y, int band);
116

    
117
   /**
118
    * Obtiene una muestra del pixel que se pasa como par?metro en la banda que se pasa como par?metro 
119
    */
120
        public byte getDataAsByte(int x, int y, int band);
121

    
122
   /**
123
    * Obtiene una muestra del pixel que se pasa como par?metro en la banda que se pasa como par?metro 
124
    */
125
        public float getDataAsFloat(int x, int y, int band);
126

    
127
   /**
128
    * Obtiene una muestra el pixel que se pasa como par?metro en la banda que se pasa como par?metro 
129
    */
130
        public double getDataAsDouble(int x, int y, int band);
131
        
132
        /**
133
         * Obtiene una imagen de tama?o especificado, de la zona (en
134
         * coordenadas de usuario) que se le pide.
135
         * @param size        Tama?o (en p?xeles de im?gen).
136
         * @param userSize Zona especificada (en coordenadas de usuario).
137
         * @param rp Reproyecci?n.
138
         * @return La imagen.
139
         */
140
        public Image getImage(Dimension size, Rectangle2D userSize, ICoordTrans rp);
141
        
142
        /**
143
         * Obtiene un array con atributos de la imagen
144
         * @return Lista de atributos
145
         */
146
        public ArrayList getAttributes();
147
        
148
        /**
149
         * Obtiene una banda
150
         * @param flag        banda a recuperar
151
         */
152
        public int getBand(int flag);
153
        
154
        /**
155
         * Devuelve la posici?n del fichero para la banda especificada.
156
         * @param flag banda.
157
         * @return posici?n del fichero
158
         */
159
        public int getPosFile(int flag);
160

    
161
        
162
        /**
163
         * Activa o desactiva la transparencia
164
         * @param t        true activa la transparencia y false la desactiva
165
         */
166
        public void setTransparency(boolean t);
167
        
168
        /**
169
         * Asocia un colorBand al rojo, verde o azul.
170
         * @param flag cual (o cuales) de las bandas.
171
         * @param nBand        que colorBand
172
         */
173
        public void setBand(int flag, int nBand);
174
                
175
        /**
176
         * Asigna un fichero al PxRaster
177
         * @param fileName Nombre del fichero
178
         */
179
        public void addFile(String fileName)throws IOException;
180

    
181
        /**
182
         * Elimina un fichero al PxRaster
183
         * @param fileName Nombre del fichero
184
         */
185
        public void delFile(String fileName);
186
        
187
        /**
188
         * Obtiene el valor del pixel del Image en la posici?n x,y
189
         * @param x Posici?n x
190
         * @param y Posici?n y
191
         * @return valor de pixel
192
         */
193
        public int[] getPixel(double wcx, double wcy);
194
                
195
        /**
196
         * Obtiene el grid asociado
197
         * @return grid
198
         */
199
        public BufferFactory getGrid();
200
        /**
201
         * Obtiene el flag que dice si la imagen est? o no georreferenciada
202
         * @return true si est? georreferenciada y false si no lo est?.
203
         */
204
        public boolean isGeoreferenced();
205
        
206
        /**
207
         * Get datasource object
208
         * @return
209
         */
210
        public BufferFactory getDatasource();
211
        
212
        /**
213
         * Get render object
214
         * @return Rendering
215
         */
216
        public Rendering getRender();
217
                        
218
}