jsky.image
Class ImageUtil

java.lang.Object
  extended by jsky.image.ImageUtil

public class ImageUtil
extends java.lang.Object

Contains static convenience and utility methods for dealing with JAI images.

Version:
$Revision: 1.1 $
Author:
Allan Brighton

Constructor Summary
ImageUtil()
           
 
Method Summary
static double getImageProperty(javax.media.jai.PlanarImage im, java.lang.String name, double defaultValue)
          Return the value of the given property for the given image as a double, or return the given default value, if the property was not defined.
static int getImageProperty(javax.media.jai.PlanarImage im, java.lang.String name, int defaultValue)
          Return the value of the given property for the given image as an int, or return the given default value, if the property was not defined.
static java.lang.String getImageProperty(javax.media.jai.PlanarImage im, java.lang.String name, java.lang.String defaultValue)
          Return the value of the given property for the given image as a String, or return the given default value, if the property was not defined.
static java.awt.RenderingHints getSampleModelHint(int tileWidth, int tileHeight, int dataType)
          Return a RenderingHints object defining the sample model (data type) of the resulting image of an operation.
static java.awt.RenderingHints getTileCacheHint(int numTiles, int tileWidth, int tileHeight)
          Return a RenderingHints object defining a tile cache with the given number of tiles of the given size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtil

public ImageUtil()
Method Detail

getImageProperty

public static double getImageProperty(javax.media.jai.PlanarImage im,
                                      java.lang.String name,
                                      double defaultValue)
Return the value of the given property for the given image as a double, or return the given default value, if the property was not defined.


getImageProperty

public static int getImageProperty(javax.media.jai.PlanarImage im,
                                   java.lang.String name,
                                   int defaultValue)
Return the value of the given property for the given image as an int, or return the given default value, if the property was not defined.


getImageProperty

public static java.lang.String getImageProperty(javax.media.jai.PlanarImage im,
                                                java.lang.String name,
                                                java.lang.String defaultValue)
Return the value of the given property for the given image as a String, or return the given default value, if the property was not defined.


getTileCacheHint

public static java.awt.RenderingHints getTileCacheHint(int numTiles,
                                                       int tileWidth,
                                                       int tileHeight)
Return a RenderingHints object defining a tile cache with the given number of tiles of the given size. This can be passed to JAI.create(...) to specify the tile cache for a given operation.


getSampleModelHint

public static java.awt.RenderingHints getSampleModelHint(int tileWidth,
                                                         int tileHeight,
                                                         int dataType)
Return a RenderingHints object defining the sample model (data type) of the resulting image of an operation.