gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.lib / org.gvsig.raster.lib.impl / src / main / java / org / gvsig / raster / impl / buffer / cache / RasterReadOnlyBuffer.java @ 1030
History | View | Annotate | Download (20 KB)
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.impl.buffer.cache; |
23 |
|
24 |
import java.awt.geom.Point2D; |
25 |
import java.io.FileNotFoundException; |
26 |
|
27 |
import org.gvsig.fmap.dal.coverage.RasterLibrary; |
28 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
29 |
import org.gvsig.fmap.dal.coverage.datastruct.Band; |
30 |
import org.gvsig.fmap.dal.coverage.datastruct.BandList; |
31 |
import org.gvsig.fmap.dal.coverage.datastruct.Extent; |
32 |
import org.gvsig.fmap.dal.coverage.exception.FileNotExistsException; |
33 |
import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException; |
34 |
import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException; |
35 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
36 |
import org.gvsig.fmap.dal.coverage.exception.RasterDriverException; |
37 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
38 |
import org.gvsig.fmap.dal.coverage.store.RasterQuery; |
39 |
import org.gvsig.raster.impl.DefaultRasterManager; |
40 |
import org.gvsig.raster.impl.buffer.RasterBuffer; |
41 |
import org.gvsig.raster.impl.datastruct.ExtentImpl; |
42 |
import org.gvsig.raster.impl.provider.DefaultRasterProvider; |
43 |
import org.gvsig.raster.impl.store.QueryableRaster; |
44 |
|
45 |
/**
|
46 |
*
|
47 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
48 |
*
|
49 |
*/
|
50 |
public class RasterReadOnlyBuffer extends RasterBuffer { |
51 |
/**
|
52 |
* Pagina cargada
|
53 |
*/
|
54 |
private Buffer page = null; |
55 |
private Buffer secondPage = null; |
56 |
/**
|
57 |
* N?mero de p?gina cargada en Buffer
|
58 |
*/
|
59 |
private int loadedPage = -1; |
60 |
private int loadedSecondPage = -1; |
61 |
|
62 |
|
63 |
private int heightLastPage = 0; |
64 |
|
65 |
private RasterDataStore datasource = null; |
66 |
|
67 |
private int bitsPag = 0; |
68 |
/**
|
69 |
* N?mero de p?ginas
|
70 |
*/
|
71 |
private int nPages = 0; |
72 |
/**
|
73 |
* Lista de bandas
|
74 |
*/
|
75 |
private BandList bandList = null; |
76 |
private int[] drawableBands = null; |
77 |
/**
|
78 |
* Extensi?n asociada al buffer
|
79 |
*/
|
80 |
private int minX = 0, minY = 0, maxX = 0, maxY = 0; |
81 |
/**
|
82 |
* Query para las cargas de p?ginas. Lleva asociado un IRasterDatasource de un raster
|
83 |
* de disco.
|
84 |
*/
|
85 |
private RasterQuery query = null; |
86 |
|
87 |
|
88 |
/**
|
89 |
* Para extraer el desplazamiento de una direcci?n (l?nea de raster) hay que hacer una operaci?n And con
|
90 |
* con la altura de la p?gina -1. Por ejemplo, una p?gina de 16 l?neas de altura el desplazamiento ser?
|
91 |
* 16 - 1 = 15 porque 15 en binario es 1111.
|
92 |
*
|
93 |
* Si queremos acceder a la linea del raster n?mero 83 (1010011) realizando la operaci?n And con el valor del
|
94 |
* desplazamiento obtenemos (0001111 & 1010011 = 0000011), es decir el valor 3 en decimal. Esto quiere decir
|
95 |
* que la l?nea 83 del raster es la 3 de su p?gina.
|
96 |
*/
|
97 |
private int offset = 1; |
98 |
|
99 |
private int bufWidth, bufHeight; |
100 |
|
101 |
/**
|
102 |
* Constructor. Asigna las variables de inicializaci?n y crea la estructura de
|
103 |
* la cach? con los datos pasados.
|
104 |
* @param dataType Tipo de dato
|
105 |
* @param width Ancho
|
106 |
* @param height Alto
|
107 |
* @param bandNr Banda
|
108 |
* @param orig
|
109 |
* @throws RasterDriverException
|
110 |
* @throws NotSupportedExtensionException
|
111 |
* @throws FileNotFoundException
|
112 |
*/
|
113 |
public RasterReadOnlyBuffer(int dataType, int width, int height, int nBand) { |
114 |
this.dataType = dataType;
|
115 |
this.width = width;
|
116 |
this.height = height;
|
117 |
this.nBands = nBand;
|
118 |
} |
119 |
|
120 |
/**
|
121 |
* Asigna los parametros relativos al buffer. Estos son el nombre del fichero asociado
|
122 |
* y la extensi?n asignada
|
123 |
* @param fileName Nombre del fichero asociado
|
124 |
* @param ext Extensi?n
|
125 |
*/
|
126 |
public void setBufferParams(QueryableRaster q, Extent ext, BandList bandList) |
127 |
throws InvalidSetViewException, FileNotExistsException, NotSupportedExtensionException {
|
128 |
this.bandList = bandList;
|
129 |
this.datasource = (RasterDataStore)q;
|
130 |
|
131 |
if( ext.minX() < datasource.getExtent().minX() || ext.minY() < datasource.getExtent().minY() ||
|
132 |
ext.maxX() > datasource.getExtent().maxX() || ext.maxY() > datasource.getExtent().maxY()) |
133 |
throw new InvalidSetViewException(""); |
134 |
|
135 |
Point2D p1 = datasource.worldToRaster(new Point2D.Double(minX, maxY)); |
136 |
Point2D p2 = datasource.worldToRaster(new Point2D.Double(maxX, minY)); |
137 |
|
138 |
this.minX = (int)p1.getX(); |
139 |
this.minY = (int)p1.getY(); |
140 |
this.maxX = (int)p2.getX(); |
141 |
this.maxY = (int)p2.getY(); |
142 |
|
143 |
init(); |
144 |
} |
145 |
|
146 |
/**
|
147 |
* Asigna los parametros relativos al buffer. Estos son el nombre del fichero asociado
|
148 |
* y la extensi?n asignada
|
149 |
* @param dataStore Dataset del fichero asociado
|
150 |
* @param minX Coordenada pixel X m?nima
|
151 |
* @param minY Coordenada pixel Y m?nima
|
152 |
* @param maxX Coordenada pixel X m?xima
|
153 |
* @param maxY Coordenada pixel Y m?xima
|
154 |
* @exception InvalidSetViewException
|
155 |
* @exception FileNotExistsException
|
156 |
* @exception NotSupportedExtensionException
|
157 |
*/
|
158 |
public void setBufferParams(QueryableRaster q, int minX, int minY, int maxX, int maxY, BandList bandList) |
159 |
throws InvalidSetViewException, FileNotExistsException, NotSupportedExtensionException {
|
160 |
this.bandList = bandList;
|
161 |
this.datasource = (RasterDataStore)q;
|
162 |
|
163 |
this.minX = minX;
|
164 |
this.minY = minY;
|
165 |
this.maxX = maxX;
|
166 |
this.maxY = maxY;
|
167 |
|
168 |
if((maxX - minX) != width)
|
169 |
bufWidth = width; |
170 |
if((maxX - minX) != width)
|
171 |
bufHeight = height; |
172 |
|
173 |
init(); |
174 |
} |
175 |
|
176 |
/**
|
177 |
* Acciones de inicializaci?n.
|
178 |
* Crear el buffer de memoria y la lista de bandas, as? comno los bits empleados
|
179 |
* por cada p?gina de memoria y el desplazamiento que supone para el calculo
|
180 |
* de direcciones.
|
181 |
*/
|
182 |
private void init() { |
183 |
//Calculo de los bits por p?gina
|
184 |
int h = RasterLibrary.blockHeight;
|
185 |
while(h > 1) { |
186 |
h >>= 1;
|
187 |
bitsPag ++; |
188 |
} |
189 |
|
190 |
//Calculo del desplazamiento
|
191 |
offset = RasterLibrary.blockHeight - 1;
|
192 |
|
193 |
//Creamos el bufferFactory asociado a la carga de p?ginas. Cada p?gina se fuerza
|
194 |
//a que sea cargada en memoria.
|
195 |
query = DefaultRasterManager.getInstance().createQuery(); |
196 |
query.setMemoryBuffer(true);
|
197 |
query.setDrawableBands(bandList.getDrawableBands()); |
198 |
|
199 |
nPages = (int)Math.ceil((double)height / (double)RasterLibrary.blockHeight); |
200 |
//double aux = ((double)height / (double)RasterLibrary.blockHeight);
|
201 |
//heightLastPage = (int)((aux - (int)aux) * RasterLibrary.blockHeight);
|
202 |
if(height % RasterLibrary.blockHeight == 0) |
203 |
heightLastPage = RasterLibrary.blockHeight; |
204 |
else {
|
205 |
double aux = ((double)height / (double)RasterLibrary.blockHeight); |
206 |
heightLastPage = (int)((aux - (int)aux) * RasterLibrary.blockHeight); |
207 |
} |
208 |
|
209 |
drawableBands = new int[datasource.getBandCount()]; |
210 |
for (int i = 0; i < drawableBands.length; i++) |
211 |
drawableBands[i] = i; |
212 |
} |
213 |
|
214 |
/*
|
215 |
* (non-Javadoc)
|
216 |
* @see org.gvsig.fmap.dal.coverage.dataset.Buffer#addDrawableBands(int[])
|
217 |
*/
|
218 |
public void addDrawableBands(int[] db) { |
219 |
if(db == null || db.length > this.bandList.getBandCount()) |
220 |
return;
|
221 |
this.bandList.setDrawableBands(db);
|
222 |
query = DefaultRasterManager.getInstance().createQuery(); |
223 |
query.setMemoryBuffer(true);
|
224 |
query.setDrawableBands(bandList.getDrawableBands()); |
225 |
} |
226 |
|
227 |
/*
|
228 |
* (non-Javadoc)
|
229 |
* @see org.gvsig.fmap.driver.Buffer#getBandCount()
|
230 |
*/
|
231 |
public int getBandCount() { |
232 |
return this.bandList.getDrawableBandsCount(); |
233 |
} |
234 |
|
235 |
|
236 |
/**
|
237 |
* Calcula la extensi?n de las p?ginas en coordenadas del mundo real
|
238 |
* @param dataset Dataset
|
239 |
* @param nPages N?mero de p?ginas en que se divide el raster
|
240 |
* @deprecated
|
241 |
* @return Extensi?n de cada p?gina
|
242 |
*/
|
243 |
public Extent[] calcExtentPages(DefaultRasterProvider dataset, int nPages) { |
244 |
Extent datasetExtent = dataset.getExtent(); |
245 |
double h = (RasterLibrary.blockHeight * dataset.getExtent().height()) / dataset.getHeight();
|
246 |
Extent[] ext = new Extent[nPages]; |
247 |
|
248 |
double minX = datasetExtent.getMin().getX();
|
249 |
double maxX = datasetExtent.getMax().getX();
|
250 |
double maxY = datasetExtent.getMax().getY();
|
251 |
double minY = maxY - h;
|
252 |
for (int i = 0; i < ext.length; i++) { |
253 |
ext[i] = new ExtentImpl(minX, maxY, maxX, minY);
|
254 |
maxY = minY; |
255 |
minY -= h; |
256 |
if(minY < datasetExtent.minY())
|
257 |
minY = datasetExtent.minY(); |
258 |
} |
259 |
return ext;
|
260 |
} |
261 |
|
262 |
public void malloc(int dataType, int width, int height, int bandNr) { |
263 |
} |
264 |
|
265 |
/*
|
266 |
* (non-Javadoc)
|
267 |
* @see org.gvsig.raster.driver.Buffer#isBandSwitchable()
|
268 |
*/
|
269 |
public boolean isBandSwitchable() { |
270 |
return false; |
271 |
} |
272 |
|
273 |
/**
|
274 |
* Carga las p?ginas de memoria cuando hay un fallo en el acceso al dato
|
275 |
* @param pag N?mero de p?gina a cargar
|
276 |
*/
|
277 |
private void loadPage(int pag) { |
278 |
try {
|
279 |
if(page == null) { |
280 |
if(bufWidth == 0 && bufHeight == 0) { |
281 |
if(pag == nPages - 1) |
282 |
query.setAreaOfInterest(minX, (RasterLibrary.blockHeight * pag) + minY, maxX - minX, heightLastPage); |
283 |
else
|
284 |
query.setAreaOfInterest(minX, (RasterLibrary.blockHeight * pag) + minY, maxX - minX, RasterLibrary.blockHeight); |
285 |
} else {
|
286 |
int hPage = Math.round((RasterLibrary.blockHeight * (maxY - minY)) / bufHeight); |
287 |
if(pag == nPages - 1) { |
288 |
int hLastPage = Math.round((heightLastPage * bufHeight) / (maxY - minY)); |
289 |
query.setAreaOfInterest(minX, (hPage * pag) + minY, maxX - minX, hLastPage, bufWidth, heightLastPage); |
290 |
} else
|
291 |
query.setAreaOfInterest(minX, (hPage * pag) + minY, maxX - minX, hPage, bufWidth, RasterLibrary.blockHeight); |
292 |
} |
293 |
page = datasource.query(query); |
294 |
loadedPage = pag; |
295 |
|
296 |
if(bufWidth == 0 && bufHeight == 0) { |
297 |
if((pag + 1) == nPages - 1) |
298 |
query.setAreaOfInterest(minX, (RasterLibrary.blockHeight * (pag + 1)) + minY, maxX - minX, heightLastPage);
|
299 |
else
|
300 |
query.setAreaOfInterest(minX, (RasterLibrary.blockHeight * (pag + 1)) + minY, maxX - minX, RasterLibrary.blockHeight);
|
301 |
} else {
|
302 |
int hPage = Math.round((RasterLibrary.blockHeight * (maxY - minY)) / bufHeight); |
303 |
if(pag == nPages - 1) { |
304 |
int hLastPage = Math.round((heightLastPage * bufHeight) / (maxY - minY)); |
305 |
query.setAreaOfInterest(minX, (hPage * (pag + 1)) + minY, maxX - minX, hLastPage, bufWidth, heightLastPage);
|
306 |
} else
|
307 |
query.setAreaOfInterest(minX, (hPage * (pag + 1)) + minY, maxX - minX, hPage, bufWidth, RasterLibrary.blockHeight);
|
308 |
} |
309 |
secondPage = datasource.query(query); |
310 |
loadedSecondPage = pag + 1;
|
311 |
} else {
|
312 |
if(pag == loadedSecondPage)
|
313 |
switchPage(); |
314 |
else {
|
315 |
switchPage(); |
316 |
if(bufWidth == 0 && bufHeight == 0) { |
317 |
if(pag == nPages - 1) |
318 |
query.setAreaOfInterest(minX, (RasterLibrary.blockHeight * pag) + minY, maxX - minX, heightLastPage); |
319 |
else
|
320 |
query.setAreaOfInterest(minX, (RasterLibrary.blockHeight * pag) + minY, maxX - minX, RasterLibrary.blockHeight); |
321 |
} else {
|
322 |
int hPage = Math.round((RasterLibrary.blockHeight * (maxY - minY)) / bufHeight); |
323 |
if(pag == nPages - 1) { |
324 |
int hLastPage = Math.round((heightLastPage * bufHeight) / (maxY - minY)); |
325 |
query.setAreaOfInterest(minX, (hPage * pag) + minY, maxX - minX, hLastPage, bufWidth, heightLastPage); |
326 |
} else
|
327 |
query.setAreaOfInterest(minX, (hPage * pag) + minY, maxX - minX, hPage, bufWidth, RasterLibrary.blockHeight); |
328 |
} |
329 |
page = datasource.query(query); |
330 |
loadedPage = pag; |
331 |
} |
332 |
} |
333 |
|
334 |
} catch (ProcessInterruptedException e) {
|
335 |
|
336 |
} catch (InvalidSetViewException e) {
|
337 |
|
338 |
} catch (RasterDriverException e) {
|
339 |
|
340 |
} finally {
|
341 |
//Al interrumpir la carga de datos de un buffer o producirse una excepci?n page quedar? como null.
|
342 |
//Tenemos que asignarle alg?n valor para que las ?ltimas consultas no den error.
|
343 |
if(page == null) { |
344 |
page = DefaultRasterManager.getInstance().createBuffer(dataType, width, height, nBands, true);
|
345 |
loadedPage = pag; |
346 |
} |
347 |
} |
348 |
} |
349 |
|
350 |
|
351 |
/**
|
352 |
* Intercambia las dos p?ginas de memoria
|
353 |
*/
|
354 |
private void switchPage() { |
355 |
Buffer aux = secondPage;
|
356 |
secondPage = page; |
357 |
page = aux; |
358 |
int auxint = loadedSecondPage;
|
359 |
loadedSecondPage = loadedPage; |
360 |
loadedPage = auxint; |
361 |
} |
362 |
|
363 |
//*********************************************************
|
364 |
|
365 |
public byte[][] getLineByte(int line) { |
366 |
int pag = line >> bitsPag;
|
367 |
if(pag != loadedPage)
|
368 |
loadPage(pag); |
369 |
return page.getLineByte(line & offset);
|
370 |
} |
371 |
|
372 |
public short[][] getLineShort(int line) { |
373 |
int pag = line >> bitsPag;
|
374 |
if(pag != loadedPage)
|
375 |
loadPage(pag); |
376 |
return page.getLineShort(line & offset);
|
377 |
} |
378 |
|
379 |
public int[][] getLineInt(int line) { |
380 |
int pag = line >> bitsPag;
|
381 |
if(pag != loadedPage)
|
382 |
loadPage(pag); |
383 |
return page.getLineInt(line & offset);
|
384 |
} |
385 |
|
386 |
public float[][] getLineFloat(int line) { |
387 |
int pag = line >> bitsPag;
|
388 |
if(pag != loadedPage)
|
389 |
loadPage(pag); |
390 |
return page.getLineFloat(line & offset);
|
391 |
} |
392 |
|
393 |
public double[][] getLineDouble(int line) { |
394 |
int pag = line >> bitsPag;
|
395 |
if(pag != loadedPage)
|
396 |
loadPage(pag); |
397 |
return page.getLineDouble(line & offset);
|
398 |
} |
399 |
|
400 |
//*********************************************************
|
401 |
|
402 |
public byte[] getLineFromBandByte(int line, int band) { |
403 |
int pag = line >> bitsPag;
|
404 |
if(pag != loadedPage)
|
405 |
loadPage(pag); |
406 |
return page.getLineFromBandByte(line & offset, band);
|
407 |
} |
408 |
|
409 |
public short[] getLineFromBandShort(int line, int band) { |
410 |
int pag = line >> bitsPag;
|
411 |
if(pag != loadedPage)
|
412 |
loadPage(pag); |
413 |
return page.getLineFromBandShort(line & offset, band);
|
414 |
} |
415 |
|
416 |
public int[] getLineFromBandInt(int line, int band) { |
417 |
int pag = line >> bitsPag;
|
418 |
if(pag != loadedPage)
|
419 |
loadPage(pag); |
420 |
return page.getLineFromBandInt(line & offset, band);
|
421 |
} |
422 |
|
423 |
public float[] getLineFromBandFloat(int line, int band) { |
424 |
int pag = line >> bitsPag;
|
425 |
if(pag != loadedPage)
|
426 |
loadPage(pag); |
427 |
return page.getLineFromBandFloat(line & offset, band);
|
428 |
} |
429 |
|
430 |
public double[] getLineFromBandDouble(int line, int band) { |
431 |
int pag = line >> bitsPag;
|
432 |
if(pag != loadedPage)
|
433 |
loadPage(pag); |
434 |
return page.getLineFromBandDouble(line & offset, band);
|
435 |
} |
436 |
|
437 |
//*********************************************************
|
438 |
|
439 |
public byte getElemByte(int line, int col, int band) { |
440 |
int pag = line >> bitsPag;
|
441 |
if(pag != loadedPage)
|
442 |
loadPage(pag); |
443 |
return page.getElemByte(line & offset, col, band);
|
444 |
} |
445 |
|
446 |
public short getElemShort(int line, int col, int band) { |
447 |
int pag = line >> bitsPag;
|
448 |
if(pag != loadedPage)
|
449 |
loadPage(pag); |
450 |
return page.getElemShort(line & offset, col, band);
|
451 |
} |
452 |
|
453 |
public int getElemInt(int line, int col, int band) { |
454 |
int pag = line >> bitsPag;
|
455 |
if(pag != loadedPage)
|
456 |
loadPage(pag); |
457 |
return page.getElemInt(line & offset, col, band);
|
458 |
} |
459 |
|
460 |
public float getElemFloat(int line, int col, int band) { |
461 |
int pag = line >> bitsPag;
|
462 |
if(pag != loadedPage)
|
463 |
loadPage(pag); |
464 |
return page.getElemFloat(line & offset, col, band);
|
465 |
} |
466 |
|
467 |
public double getElemDouble(int line, int col, int band) { |
468 |
int pag = line >> bitsPag;
|
469 |
if(pag != loadedPage)
|
470 |
loadPage(pag); |
471 |
return page.getElemDouble(line & offset, col, band);
|
472 |
} |
473 |
|
474 |
//*********************************************************
|
475 |
|
476 |
public void getElemByte(int line, int col, byte[] data) { |
477 |
int pag = line >> bitsPag;
|
478 |
if(pag != loadedPage)
|
479 |
loadPage(pag); |
480 |
page.getElemByte(line & offset, col, data); |
481 |
} |
482 |
|
483 |
public void getElemShort(int line, int col, short[] data) { |
484 |
int pag = line >> bitsPag;
|
485 |
if(pag != loadedPage)
|
486 |
loadPage(pag); |
487 |
page.getElemShort(line & offset, col, data); |
488 |
} |
489 |
|
490 |
public void getElemInt(int line, int col, int[] data) { |
491 |
int pag = line >> bitsPag;
|
492 |
if(pag != loadedPage)
|
493 |
loadPage(pag); |
494 |
page.getElemInt(line & offset, col, data); |
495 |
} |
496 |
|
497 |
public void getElemFloat(int line, int col, float[] data) { |
498 |
int pag = line >> bitsPag;
|
499 |
if(pag != loadedPage)
|
500 |
loadPage(pag); |
501 |
page.getElemFloat(line & offset, col, data); |
502 |
} |
503 |
|
504 |
public void getElemDouble(int line, int col, double[] data) { |
505 |
int pag = line >> bitsPag;
|
506 |
if(pag != loadedPage)
|
507 |
loadPage(pag); |
508 |
page.getElemDouble(line & offset, col, data); |
509 |
} |
510 |
|
511 |
//***********************************************
|
512 |
//Obtiene una banda entera
|
513 |
|
514 |
public Band getBand(int band){ |
515 |
return null; |
516 |
} |
517 |
|
518 |
/*
|
519 |
* (non-Javadoc)
|
520 |
* @see org.gvsig.fmap.driver.Buffer#getBandBuffer(int)
|
521 |
*/
|
522 |
public Buffer getBandBuffer(int Band){ |
523 |
return null; |
524 |
} |
525 |
|
526 |
public void replicateBand(int orig, int dest) { |
527 |
} |
528 |
|
529 |
/*
|
530 |
* (non-Javadoc)
|
531 |
* @see org.gvsig.fmap.dataaccess.buffer.RasterBuffer#switchBands(int[])
|
532 |
*/
|
533 |
public void switchBands(int[] bandPosition){ |
534 |
|
535 |
} |
536 |
|
537 |
//*********************************************************
|
538 |
|
539 |
/*
|
540 |
* (non-Javadoc)
|
541 |
* @see org.gvsig.fmap.driver.Buffer#cloneBuffer()
|
542 |
*/
|
543 |
public Buffer cloneBuffer(){ |
544 |
return null; |
545 |
} |
546 |
|
547 |
|
548 |
/*
|
549 |
* (non-Javadoc)
|
550 |
* @see org.gvsig.fmap.driver.Buffer#mallocOneBand(int, int, int, int)
|
551 |
*/
|
552 |
public void mallocOneBand(int dataType, int width, int height, int band) { |
553 |
|
554 |
} |
555 |
|
556 |
/*
|
557 |
* (non-Javadoc)
|
558 |
* @see org.gvsig.fmap.driver.Buffer#copyBand(int, org.gvsig.fmap.dataaccess.buffer.Band)
|
559 |
*/
|
560 |
public void copyBand(int nBand, Band band) { |
561 |
|
562 |
} |
563 |
|
564 |
/*
|
565 |
* (non-Javadoc)
|
566 |
* @see org.gvsig.fmap.driver.Buffer#assignBand(int, org.gvsig.fmap.dataaccess.buffer.Band)
|
567 |
*/
|
568 |
public void assignBand(int nBand, Band band) { |
569 |
|
570 |
} |
571 |
|
572 |
/*
|
573 |
* (non-Javadoc)
|
574 |
* @see org.gvsig.fmap.driver.Buffer#createBand(byte)
|
575 |
*/
|
576 |
public Band createBand(byte defaultValue) { |
577 |
|
578 |
return null; |
579 |
} |
580 |
|
581 |
public void assignBandToNotValid(int Band) {} |
582 |
public void assign(int band, byte value) {} |
583 |
public void assign(int band, short value) {} |
584 |
public void assign(int band, int value) {} |
585 |
public void assign(int band, float value) {} |
586 |
public void assign(int band, double value) {} |
587 |
public void interchangeBands(int band1, int band2) {} |
588 |
public void setElem(int line, int col, int band, byte data) {} |
589 |
public void setElem(int line, int col, int band, short data) {} |
590 |
public void setElem(int line, int col, int band, int data) {} |
591 |
public void setElem(int line, int col, int band, float data) {} |
592 |
public void setElem(int line, int col, int band, double data) {} |
593 |
public void setElemByte(int line, int col, byte[] data) {} |
594 |
public void setElemDouble(int line, int col, double[] data) {} |
595 |
public void setElemFloat(int line, int col, float[] data) {} |
596 |
public void setElemInt(int line, int col, int[] data) {} |
597 |
public void setElemShort(int line, int col, short[] data) {} |
598 |
public void setLineByte(byte[][] data, int line) {} |
599 |
public void setLineDouble(double[][] data, int line) {} |
600 |
public void setLineFloat(float[][] data, int line) {} |
601 |
public void setLineInBandByte(byte[] data, int line, int band) {} |
602 |
public void setLineInBandDouble(double[] data, int line, int band) {} |
603 |
public void setLineInBandFloat(float[] data, int line, int band) {} |
604 |
public void setLineInBandInt(int[] data, int line, int band) {} |
605 |
public void setLineInBandShort(short[] data, int line, int band) {} |
606 |
public void setLineInt(int[][] data, int line) {} |
607 |
public void setLineShort(short[][] data, int line) {} |
608 |
|
609 |
/*
|
610 |
* (non-Javadoc)
|
611 |
* @see org.gvsig.fmap.dal.coverage.dataset.Buffer#isReadOnlyBuffer()
|
612 |
*/
|
613 |
public boolean isReadOnlyBuffer() { |
614 |
return true; |
615 |
} |
616 |
|
617 |
/*
|
618 |
* (non-Javadoc)
|
619 |
* @see org.gvsig.fmap.dal.coverage.dataset.Buffer#isCached()
|
620 |
*/
|
621 |
public boolean isCached() { |
622 |
return true; |
623 |
} |
624 |
|
625 |
/*
|
626 |
* (non-Javadoc)
|
627 |
* @see org.gvsig.fmap.dal.coverage.dataset.Buffer#getBlockHeight()
|
628 |
*/
|
629 |
public int getBlockHeight() { |
630 |
return RasterLibrary.blockHeight;
|
631 |
} |
632 |
|
633 |
/*
|
634 |
* (non-Javadoc)
|
635 |
* @see org.gvsig.raster.dataset.Buffer#free()
|
636 |
*/
|
637 |
public void free() { |
638 |
if(page != null) |
639 |
page.free(); |
640 |
datasource = null;
|
641 |
bandList = null;
|
642 |
} |
643 |
|
644 |
//****************************************************
|
645 |
//*********Implementing Disposable methods************
|
646 |
//****************************************************
|
647 |
|
648 |
/*
|
649 |
* (non-Javadoc)
|
650 |
* @see org.gvsig.tools.dispose.Disposable#dispose()
|
651 |
*/
|
652 |
public void dispose() { |
653 |
free(); |
654 |
} |
655 |
} |