us.zuercher.gpx2map.image.netpbm
Class NetpbmStitcher

java.lang.Object
  extended by us.zuercher.gpx2map.image.netpbm.NetpbmStitcher

public class NetpbmStitcher
extends Object

NetpbmStitcher concatenates NetpbmImage files horizontally and vertically to produce a single larger image.

Author:
Stephan Zuercher

Field Summary
private  List<List<NetpbmImage>> tileImages
          List of Lists of NetpbmImage objects.
 
Constructor Summary
NetpbmStitcher(List<List<File>> tileFiles, boolean gzipped)
          Constructs a new NetpbmStitcher for the given files.
 
Method Summary
 void execute(File outputFile, ProgressMeter meter)
          Perform the stitching.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tileImages

private final List<List<NetpbmImage>> tileImages
List of Lists of NetpbmImage objects. Each member of tileImages is a row in the final image.

Constructor Detail

NetpbmStitcher

public NetpbmStitcher(List<List<File>> tileFiles,
                      boolean gzipped)
               throws IOException
Constructs a new NetpbmStitcher for the given files. Each element of tileFiles is a List<File> that represents a horizontal stripe of the output image. All NetpbmImage objects provided must be for files of the same horizontal and vertical dimensions. This constructor copies the data in tileFiles. Modifications made to the list after calling the constructor will have no effect.

Although this method accepts PAM-format images, it ignores the image's transparency, if any.

Parameters:
tileFiles - NetpbmImage files used to build the output image
gzipped - indicates whether the NetpbmImage objects are compressed
Throws:
IOException - if a Netpbm image file cannot be opened
Method Detail

execute

public void execute(File outputFile,
                    ProgressMeter meter)
             throws IOException
Perform the stitching. Output is written to outputFile, using meter to indicate progress.

Parameters:
outputFile - target image file
meter - progress meteer
Throws:
IOException - if there's an error reading or writing
IllegalStateException - if the input NetpbmImages are not all of equal size