Revision 11283 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/saveraster/operations/RasterizerLayer.java
RasterizerLayer.java | ||
---|---|---|
25 | 25 |
import java.awt.image.BufferedImage; |
26 | 26 |
|
27 | 27 |
import org.cresques.filter.RasterBuf; |
28 |
import org.cresques.filter.RasterStats.History; |
|
28 |
import org.gvsig.raster.buffer.IQueryableRaster; |
|
29 |
import org.gvsig.raster.dataset.IDataWriter; |
|
29 | 30 |
|
30 | 31 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
31 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
32 | 32 |
import com.iver.cit.gvsig.fmap.MapControl; |
33 | 33 |
import com.iver.cit.gvsig.fmap.ViewPort; |
34 | 34 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
35 | 35 |
import com.iver.cit.gvsig.fmap.layers.FLyrRaster; |
36 | 36 |
import com.iver.cit.gvsig.fmap.layers.RasterOperations; |
37 |
import com.iver.cit.gvsig.project.documents.table.gui.Statistics; |
|
38 | 37 |
import com.iver.utiles.swing.threads.Cancellable; |
39 | 38 |
|
40 | 39 |
/** |
... | ... | |
45 | 44 |
* ser? llamado desde el driver cada vez que vacie el buffer y |
46 | 45 |
* necesite m?s datos. |
47 | 46 |
*/ |
48 |
public class RasterizerLayer { |
|
47 |
public class RasterizerLayer implements IDataWriter{
|
|
49 | 48 |
|
50 | 49 |
private ViewPort viewPort = null; |
51 | 50 |
private ViewPort viewPortBlock = null; |
... | ... | |
99 | 98 |
* @param sizeBlock altura del bloque que se lee de una vez en la imagen de entrada |
100 | 99 |
* @param mapCtrl Mapcontrol |
101 | 100 |
*/ |
102 |
public RasterizerLayer(FLayers flyrs, ViewPort vp, int sB, MapControl mapCtrl, SaveRasterThread thread) {
|
|
101 |
public RasterizerLayer(FLayers flyrs, ViewPort vp, int sB, MapControl mapCtrl) { |
|
103 | 102 |
|
104 | 103 |
//Recorremos todas las capas comprobando si alguna de ellas implementa RasterOperations y tilea. |
105 | 104 |
//En ese caso se obtiene el ancho de bloque. El ancho de bloque total ser? el menor obtenido. |
... | ... | |
110 | 109 |
boolean isTiling = false; |
111 | 110 |
int block = Integer.MAX_VALUE; |
112 | 111 |
for(int i = 0; i < flyrs.getLayersCount(); i++){ |
113 |
if(flyrs.getLayer(i) instanceof RasterOperations){
|
|
114 |
if(((RasterOperations)flyrs.getLayer(i)).isTiled()){
|
|
115 |
wBlock = ((RasterOperations)flyrs.getLayer(i)).getTileSize();
|
|
112 |
if(flyrs.getLayer(i) instanceof IQueryableRaster){
|
|
113 |
if(((IQueryableRaster)flyrs.getLayer(i)).isTiled()){
|
|
114 |
wBlock = ((IQueryableRaster)flyrs.getLayer(i)).getTileSize();
|
|
116 | 115 |
if((wBlock[0] - 1)< block){ |
117 | 116 |
block = wBlock[0] - 1; |
118 | 117 |
isTiling = true; |
... | ... | |
122 | 121 |
} |
123 | 122 |
if(isTiling){ |
124 | 123 |
setSizeBlock(block); |
125 |
thread.setBlockSize(block); |
|
124 |
//thread.setBlockSize(block);
|
|
126 | 125 |
} |
127 | 126 |
|
128 | 127 |
backgroundColor = vp.getBackColor(); |
... | ... | |
245 | 244 |
this.sizeBlock = sizeBlock; |
246 | 245 |
} |
247 | 246 |
|
247 |
/** |
|
248 |
* No tiene uso en RasterizerLayer |
|
249 |
*/ |
|
250 |
public byte[][] readByteData(int sizeX, int sizeY) { |
|
251 |
return null; |
|
252 |
} |
|
253 |
|
|
254 |
/** |
|
255 |
* No tiene uso en RasterizerLayer |
|
256 |
*/ |
|
257 |
public double[][] readDoubleData(int sizeX, int sizeY) { |
|
258 |
return null; |
|
259 |
} |
|
260 |
|
|
261 |
/** |
|
262 |
* No tiene uso en RasterizerLayer |
|
263 |
*/ |
|
264 |
public float[][] readFloatData(int sizeX, int sizeY) { |
|
265 |
return null; |
|
266 |
} |
|
267 |
|
|
268 |
/** |
|
269 |
* No tiene uso en RasterizerLayer |
|
270 |
*/ |
|
271 |
public int[][] readIntData(int sizeX, int sizeY) { |
|
272 |
return null; |
|
273 |
} |
|
274 |
|
|
275 |
/** |
|
276 |
* No tiene uso en RasterizerLayer |
|
277 |
*/ |
|
278 |
public short[][] readShortData(int sizeX, int sizeY) { |
|
279 |
return null; |
|
280 |
} |
|
281 |
|
|
248 | 282 |
} |
Also available in: Unified diff