Creating tiled image from multiple tiff sources in JAI

  • Thread starter Michael David Pedersen
  • Start date
M

Michael David Pedersen

Hi all,

My situation is as follows. I have a number of tiff files containing
adjacent tiles which I would like to combine into one image. Currently I
achieve this goal in the following manner using the Java Advanced Imaging
library:

1) Create a target TiledImage with attributes appropriate to hold all tiles.
2) Load each tiff file into a separate PlanarImage.
3) Get the Rasters of each of these PlanarImages and translate coordinates
according to the rectangle they must occupy in the target TiledImage
4) Invoke TiledImage.setData(Raster) with the translated raster for each
tile

This works ok, but it does not seem to take advantage of the JAI's
pull-model; image data is loaded into memory immediately, probably as a
consequence of the call to getRaster(). However I wish to defer the loading
of image data into memory until it is needed, because only a subset of all
tiles are two be displayed at any one time.

I hence believe I need something along the lines of the NullOpImage class.
Unfortunately, the constructor for this class only takes a single source,
while I need to be able to pass a source for each tiff tile. One solution is
to subclass NullOpImage (or its superclass, PointOpImage) and take care of
things myself. Is this the way to go about it, or is there a better and
easier solution?

Any suggestions will be greatly appreciated.
Regards,
Michael.
 
A

ak

My situation is as follows. I have a number of tiff files containing
adjacent tiles which I would like to combine into one image. Currently I
achieve this goal in the following manner using the Java Advanced Imaging
library:

1) Create a target TiledImage with attributes appropriate to hold all tiles.
2) Load each tiff file into a separate PlanarImage.
3) Get the Rasters of each of these PlanarImages and translate coordinates
according to the rectangle they must occupy in the target TiledImage
4) Invoke TiledImage.setData(Raster) with the translated raster for each
tile

I think this is a wrong way, there is a special OP for such things.
Search JAI-INTEREST ARCHIVES
(http://archives.java.sun.com/cgi-bin/wa?A0=JAI-INTEREST&D=0&I=-3)
for Mosaic.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top