Revision 1081 org.gvsig.raster/trunk/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterBuffer.java
RasterBuffer.java | ||
---|---|---|
27 | 27 |
import org.gvsig.fmap.dal.coverage.RasterLibrary; |
28 | 28 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
29 | 29 |
import org.gvsig.fmap.dal.coverage.datastruct.NoData; |
30 |
import org.gvsig.fmap.dal.coverage.exception.HistogramException; |
|
31 | 30 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
32 | 31 |
import org.gvsig.fmap.dal.coverage.process.IncrementableTask; |
33 | 32 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
... | ... | |
87 | 86 |
*/ |
88 | 87 |
protected double notValidValue = 0D; |
89 | 88 |
|
90 |
private BufferInterpolation interp = null; |
|
91 |
|
|
92 | 89 |
/** |
93 | 90 |
* Proceso del cual se devuelve el porcentaje cuando este es solicitado |
94 | 91 |
*/ |
95 | 92 |
private int process = INTERPOLATION_PROCESS; |
96 | 93 |
private HistogramComputer histogramComputer = null; |
94 |
private BufferInterpolation interp = null; |
|
97 | 95 |
|
98 | 96 |
/* |
99 | 97 |
* (non-Javadoc) |
... | ... | |
316 | 314 |
* @see org.gvsig.fmap.driver.Buffer#cloneBuffer() |
317 | 315 |
*/ |
318 | 316 |
public abstract Buffer cloneBuffer(); |
319 |
|
|
317 |
|
|
320 | 318 |
/** |
321 | 319 |
* Ajusta el ?rea del grid a un ancho y un alto dado en pixeles. Este ajuste se har? |
322 | 320 |
* en relaci?n a un m?todo de interpolaci?n definido en el par?metro. |
... | ... | |
325 | 323 |
* @param interpolation M?todo de interpolaci?n que se usar? en el ajuste. |
326 | 324 |
*/ |
327 | 325 |
public Buffer getAdjustedWindow(int w, int h, int interpolationMethod) throws ProcessInterruptedException { |
328 |
if (interp == null) |
|
329 |
interp = new BufferInterpolation(this); |
|
330 |
|
|
326 |
getBufferInterpolation(); |
|
331 | 327 |
if (w == getWidth() && h == getHeight()) |
332 | 328 |
return this; |
333 | 329 |
Buffer rasterBuf = null; |
... | ... | |
358 | 354 |
* (non-Javadoc) |
359 | 355 |
* @see org.gvsig.fmap.dal.coverage.dataset.Buffer#getIncrementableTask() |
360 | 356 |
*/ |
361 |
public IncrementableTask getIncrementableTask() { |
|
362 |
return interp; |
|
357 |
public IncrementableTask getIncrementableTask(int type) { |
|
358 |
switch (type) { |
|
359 |
case INCREMENTABLE_INTERPOLATION: |
|
360 |
return getBufferInterpolation(); |
|
361 |
case INCREMENTABLE_HISTOGRAM: |
|
362 |
return getHistogramComputer(); |
|
363 |
} |
|
364 |
return null; |
|
363 | 365 |
} |
364 | 366 |
|
365 |
public BufferInterpolation getLastInterpolation() { |
|
367 |
/** |
|
368 |
* Gets the buffer interpolation |
|
369 |
* @return |
|
370 |
*/ |
|
371 |
private BufferInterpolation getBufferInterpolation() { |
|
372 |
if(interp == null) |
|
373 |
interp = new BufferInterpolation(this); |
|
366 | 374 |
return interp; |
367 | 375 |
} |
368 | 376 |
|
... | ... | |
370 | 378 |
* (non-Javadoc) |
371 | 379 |
* @see org.gvsig.fmap.dal.coverage.store.props.Histogramable#getHistogramComputer() |
372 | 380 |
*/ |
373 |
public HistogramComputer getHistogramComputer() |
|
374 |
throws HistogramException, InterruptedException { |
|
381 |
public HistogramComputer getHistogramComputer() { |
|
375 | 382 |
if(histogramComputer == null) |
376 | 383 |
histogramComputer = new BufferHistogramComputer(this); |
377 | 384 |
return histogramComputer; |
... | ... | |
726 | 733 |
*/ |
727 | 734 |
protected void finalize() throws Throwable { |
728 | 735 |
histogramComputer = null; |
729 |
interp = null; |
|
730 | 736 |
store = null; |
731 | 737 |
dataExtent = null; |
732 | 738 |
cancel = null; |
Also available in: Unified diff