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