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.
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.