com.c3d.image.hips
Class HIPS

java.lang.Object
  |
  +--com.c3d.image.hips.HIPS

public class HIPS
extends java.lang.Object

Static utility functions allowing the use of HIPS2 images in Java programs


Constructor Summary
HIPS()
           
 
Method Summary
static java.awt.Image AWTImage(HipsImage img, double scale, int index)
           
static HipsByteImage concat(HipsByteImage[] images)
          Concatenate some images together
static HipsImage filter(HipsImage img, java.lang.String s)
          Filter a HIPS image using a standard executable filter run as a separate process.
static HipsImage loadImage(java.awt.Image img)
          Create a HIPS image from an AWT image.
static HipsImage loadImage(java.io.InputStream in)
          Load a HIPS image from an input stream.
static HipsImage loadImage(java.lang.String fileName)
          Load a HIPS image from a file.
static HipsImage loadTIF(java.lang.String fileName)
           
static void writeImage(HipsImage hdr, java.io.OutputStream out)
          Save a HIPS image to an OutputStream
static void writeImage(HipsImage hdr, java.lang.String fileName)
          Save a HIPS image to file.
static void writeImage(java.awt.Image img, java.lang.String fileName)
          Save an AWT image to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HIPS

public HIPS()
Method Detail

loadImage

public static HipsImage loadImage(java.lang.String fileName)
                           throws HipsException,
                                  java.io.IOException
Load a HIPS image from a file. If the file isn't in HIPS format then we try and load the image using the standard Java getImage method, and convert this to HIPS format.
Parameters:
fileName - The local name for the file

loadImage

public static HipsImage loadImage(java.io.InputStream in)
                           throws HipsException,
                                  java.io.IOException
Load a HIPS image from an input stream. The stream is left open. The image types known about are byte, float and Point3f. If the image isn't one of the first two it is assumed to be Point3f if the size of pixel is 12 bytes. If none of these formats fits an exception is thrown.
Parameters:
in - The input data stream

loadTIF

public static HipsImage loadTIF(java.lang.String fileName)

loadImage

public static HipsImage loadImage(java.awt.Image img)
                           throws HipsException,
                                  java.io.IOException
Create a HIPS image from an AWT image. The image will be byte-coded color, with 3 color channels.

writeImage

public static void writeImage(HipsImage hdr,
                              java.lang.String fileName)
                       throws java.io.IOException
Save a HIPS image to file.

writeImage

public static void writeImage(HipsImage hdr,
                              java.io.OutputStream out)
                       throws java.io.IOException
Save a HIPS image to an OutputStream

writeImage

public static void writeImage(java.awt.Image img,
                              java.lang.String fileName)
                       throws HipsException,
                              java.io.IOException
Save an AWT image to a file

filter

public static HipsImage filter(HipsImage img,
                               java.lang.String s)
Filter a HIPS image using a standard executable filter run as a separate process.
Parameters:
hdr - The HIPS header. This should have data attached.
s - The filter to be executed, including the command line arguments to run the filter. The arguments are parsed using StringTokenizer so make sure that this will work, otherwise use the multi-argument version of filter.

AWTImage

public static java.awt.Image AWTImage(HipsImage img,
                                      double scale,
                                      int index)

concat

public static HipsByteImage concat(HipsByteImage[] images)
Concatenate some images together