我試圖使用JAI創建單個鑲嵌組成4個TIF圖像的每一個是5000 X 5000我所編寫的代碼是如下圖像的馬賽克..問題創建使用JAI
RenderedOp mosaic=null;
ParameterBlock pbMosaic=new ParameterBlock();
pbMosaic.add(MosaicDescriptor.MOSAIC_TYPE_OVERLAY);
RenderedOp in=null;
// Get 4 tiles and add them to the Mosaic
in=returnRenderedOp(path,"northwest.tif");
pbMosaic.addSource(in);
in=returnRenderedOp(path,"northeast.tif");
pbMosaic.addSource(in);
in=returnRenderedOp(path,"southwest.tif");
pbMosaic.addSource(in);
in=returnRenderedOp(path,"southeast.tif");
pbMosaic.addSource(in);
// Setup the ImageLayout
ImageLayout imageLayout=new ImageLayout(0,0,10000,10000);
imageLayout.setTileWidth(5000);
imageLayout.setTileHeight(5000);
imageLayout.setColorModel(in.getColorModel());
imageLayout.setSampleModel(in.getSampleModel());
mosaic=JAI.create("mosaic",pbMosaic,new RenderingHints(JAI.KEY_IMAGE_LAYOUT,imageLayout));
問題是,所有4張圖像都位於鑲嵌圖左上角的相同位置,所以其他四分之三的圖像都是空的。任何人都可以告訴我如何選擇組成馬賽克的每幅圖片的位置,以便每個圖片都出現在正確的位置?
感謝
伊恩