Revision 203 trunk/libraries/libCq CMS for java.old/src/org/cresques/io/GeoRasterFile.java
GeoRasterFile.java | ||
---|---|---|
31 | 31 |
*/ |
32 | 32 |
|
33 | 33 |
public abstract class GeoRasterFile extends GeoFile { |
34 |
public static final int RED_BAND = 0x01; |
|
35 |
public static final int GREEN_BAND = 0x02; |
|
36 |
public static final int BLUE_BAND = 0x04; |
|
37 | 34 |
/** |
38 | 35 |
* Filtro para raster. |
39 | 36 |
* Permite eliminar la franja inutil alrededor de un raster girado o de |
... | ... | |
132 | 129 |
|
133 | 130 |
static { |
134 | 131 |
supportedExtensions = new TreeMap(); |
135 |
if (System.getProperty("os.name").toUpperCase().startsWith("WIN")) { |
|
136 |
supportedExtensions.put("ecw", EcwFile.class); |
|
137 |
} |
|
132 |
supportedExtensions.put("ecw", EcwFile.class); |
|
138 | 133 |
supportedExtensions.put("tif", TifGeoRefFile.class); |
139 | 134 |
supportedExtensions.put("tiff", TifGeoRefFile.class); |
140 | 135 |
supportedExtensions.put("jpg", TifGeoRefFile.class); |
... | ... | |
197 | 192 |
*/ |
198 | 193 |
public static void registerExtension(String ext, Class clase) { |
199 | 194 |
ext = ext.toLowerCase(); |
200 |
System.out.println("RASTER: extension '"+ext+"' supported."); |
|
201 | 195 |
supportedExtensions.put(ext, clase); |
202 | 196 |
} |
203 | 197 |
|
204 |
/** |
|
205 |
* Tipo de fichero soportado. |
|
206 |
* Devuelve true si el tipo de fichero (extension) est? soportado, si no |
|
207 |
* devuelve false. |
|
208 |
* |
|
209 |
* @param fName Fichero raster |
|
210 |
* @return true si est? soportado, si no false. |
|
211 |
*/ |
|
212 | 198 |
|
213 |
public static boolean fileIsSupported(String fName) { |
|
214 |
String ext = fName.toLowerCase().substring(fName.lastIndexOf('.')+1); |
|
215 |
return supportedExtensions.containsKey(ext); |
|
216 |
} |
|
217 |
|
|
218 |
|
|
219 | 199 |
public GeoRasterFile(IProjection proj, String name) { |
220 | 200 |
super(proj, name); |
221 | 201 |
} |
222 | 202 |
|
223 | 203 |
abstract public GeoFile load(); |
224 | 204 |
|
225 |
abstract public void close(); |
|
226 |
|
|
227 | 205 |
public static PxContour getContour(String fName, String name, IProjection proj) { |
228 | 206 |
PxContour contour = null; |
229 | 207 |
return contour; |
... | ... | |
243 | 221 |
public void setUpdatable(Component c) { updatable = c; } |
244 | 222 |
|
245 | 223 |
abstract public Image updateImage(int width, int height, ICoordTrans rp); |
246 |
|
|
247 |
/** |
|
248 |
* Actualiza la/s banda/s especificadas en la imagen. |
|
249 |
* @param width ancho |
|
250 |
* @param height alto |
|
251 |
* @param rp reproyecci?n |
|
252 |
* @param img imagen |
|
253 |
* @param flags que bandas [ RED_BAND | GREEN_BAND | BLUE_BAND ] |
|
254 |
* @return img |
|
255 |
*/ |
|
256 |
abstract public Image updateImage(int width, int height, ICoordTrans rp, Image img, int flags); |
|
257 | 224 |
|
258 | 225 |
public IObjList getObjects() { |
259 | 226 |
// TODO hay que a?adir el raster a la lista de objetos |
Also available in: Unified diff