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/cache/PageBuffer.java
PageBuffer.java | ||
---|---|---|
28 | 28 |
import org.gvsig.fmap.dal.coverage.dataset.Buffer; |
29 | 29 |
import org.gvsig.fmap.dal.coverage.datastruct.Band; |
30 | 30 |
import org.gvsig.fmap.dal.coverage.datastruct.NoData; |
31 |
import org.gvsig.fmap.dal.coverage.exception.HistogramException; |
|
32 | 31 |
import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException; |
33 | 32 |
import org.gvsig.fmap.dal.coverage.process.IncrementableTask; |
34 | 33 |
import org.gvsig.fmap.dal.coverage.store.RasterDataStore; |
35 | 34 |
import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer; |
36 | 35 |
import org.gvsig.raster.impl.buffer.BufferHistogramComputer; |
36 |
import org.gvsig.raster.impl.buffer.BufferInterpolation; |
|
37 | 37 |
import org.gvsig.raster.impl.process.RasterTask; |
38 | 38 |
import org.gvsig.raster.impl.process.RasterTaskQueue; |
39 | 39 |
import org.gvsig.tools.exception.BaseException; |
... | ... | |
51 | 51 |
private PageBandBuffer[] pageBandBuffer = null; |
52 | 52 |
private double[] limits = null; |
53 | 53 |
private HistogramComputer histogramComputer = null; |
54 |
private BufferInterpolation interp = null; |
|
54 | 55 |
|
55 | 56 |
/** |
56 | 57 |
* Constructor |
... | ... | |
713 | 714 |
* (non-Javadoc) |
714 | 715 |
* @see org.gvsig.fmap.dal.coverage.store.props.Histogramable#getHistogramComputer() |
715 | 716 |
*/ |
716 |
public HistogramComputer getHistogramComputer() |
|
717 |
throws HistogramException, InterruptedException { |
|
717 |
public HistogramComputer getHistogramComputer() { |
|
718 | 718 |
if(histogramComputer == null) |
719 | 719 |
histogramComputer = new BufferHistogramComputer(this); |
720 | 720 |
return histogramComputer; |
... | ... | |
750 | 750 |
* (non-Javadoc) |
751 | 751 |
* @see org.gvsig.fmap.dal.coverage.dataset.Buffer#getIncrementableTask() |
752 | 752 |
*/ |
753 |
public IncrementableTask getIncrementableTask() { |
|
753 |
public IncrementableTask getIncrementableTask(int type) { |
|
754 |
switch (type) { |
|
755 |
case INCREMENTABLE_INTERPOLATION: |
|
756 |
return getBufferInterpolation(); |
|
757 |
case INCREMENTABLE_HISTOGRAM: |
|
758 |
return getHistogramComputer(); |
|
759 |
} |
|
754 | 760 |
return null; |
755 | 761 |
} |
756 | 762 |
|
763 |
/** |
|
764 |
* Gets the buffer interpolation |
|
765 |
* @return |
|
766 |
*/ |
|
767 |
private BufferInterpolation getBufferInterpolation() { |
|
768 |
if(interp == null) |
|
769 |
interp = new BufferInterpolation(this); |
|
770 |
return interp; |
|
771 |
} |
|
772 |
|
|
757 | 773 |
/* |
758 | 774 |
* (non-Javadoc) |
759 | 775 |
* @see org.gvsig.fmap.dal.coverage.buffer.Buffer#getAdjustedWindow(int, int, int) |
760 | 776 |
*/ |
761 | 777 |
public Buffer getAdjustedWindow(int w, int h, int interpolationMethod) throws ProcessInterruptedException { |
762 |
return null; |
|
778 |
getBufferInterpolation(); |
|
779 |
if (w == getWidth() && h == getHeight()) |
|
780 |
return this; |
|
781 |
Buffer rasterBuf = null; |
|
782 |
switch (interpolationMethod) { |
|
783 |
case Buffer.INTERPOLATION_NearestNeighbour: |
|
784 |
rasterBuf = interp.adjustRasterNearestNeighbourInterpolation(w, h); |
|
785 |
break; |
|
786 |
case Buffer.INTERPOLATION_Bilinear: |
|
787 |
rasterBuf = interp.adjustRasterBilinearInterpolation(w, h); |
|
788 |
break; |
|
789 |
case Buffer.INTERPOLATION_InverseDistance: |
|
790 |
rasterBuf = interp.adjustRasterInverseDistanceInterpolation(w, h); |
|
791 |
break; |
|
792 |
case Buffer.INTERPOLATION_BicubicSpline: |
|
793 |
rasterBuf = interp.adjustRasterBicubicSplineInterpolation(w, h); |
|
794 |
break; |
|
795 |
case Buffer.INTERPOLATION_BSpline: |
|
796 |
rasterBuf = interp.adjustRasterBSplineInterpolation(w, h); |
|
797 |
break; |
|
798 |
} |
|
799 |
if (rasterBuf != null) |
|
800 |
return rasterBuf; |
|
801 |
else |
|
802 |
return this; |
|
763 | 803 |
} |
764 | 804 |
|
765 | 805 |
public Rectangle2D getDataExtent() { |
Also available in: Unified diff