Creating tiled image from multiple tiff sources in JAI

Discussion in 'Java' started by Michael David Pedersen, Jul 21, 2004.

  1. 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.
     
    Michael David Pedersen, Jul 21, 2004
    #1
    1. Advertising

  2. Michael David Pedersen

    ak Guest

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

    --
    Andrei Kouznetsov
    http://uio.dev.java.net Unified I/O for Java
    http://reader.imagero.com Java image reader
     
    ak, Jul 21, 2004
    #2
    1. Advertising

  3. Hi Andrei,

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


    Thank you, that is exactly what I was looking for. I couldn't find mention
    of the Mosaic class in the "Programming in Java Advanced Imaging" guide, but
    apparently it is a relatively new addition.

    Regards,
    Michael.
     
    Michael David Pedersen, Jul 22, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chuck Taylor
    Replies:
    1
    Views:
    8,354
    Chuck Taylor
    Sep 4, 2003
  2. cyril
    Replies:
    1
    Views:
    816
    cyril
    Sep 8, 2003
  3. surendra
    Replies:
    1
    Views:
    8,467
    dipakPardesi
    Jun 21, 2008
  4. Douglas at AI

    Need Raw Tile Data of Tiled Tiff

    Douglas at AI, Sep 30, 2005, in forum: Java
    Replies:
    1
    Views:
    630
    Andrey Kuznetsov
    Sep 30, 2005
  5. voncroy14
    Replies:
    0
    Views:
    1,084
    voncroy14
    Jul 17, 2009
Loading...

Share This Page