ecologylab.generic
Class ImageTools

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.generic.ImageTools

public class ImageTools
extends Debug

A set of lovely convenience methods for working with images.


Constructor Summary
ImageTools()
           
 
Method Summary
static void copyImage(java.awt.image.BufferedImage srcImage, java.awt.image.BufferedImage destImage)
          Make a copy of the BufferedImage.
static void scaleAndCopyImage(int newWidth, int newHeight, java.awt.image.BufferedImage srcImage, java.awt.image.BufferedImage destImage)
          Make a scaled copy of the BufferedImage.
static void writeJpegFile(java.awt.image.BufferedImage image, java.lang.String fileName, float compressionQuality, int width, int height)
          Take the RenderedImage passed in, compress it, and writes it to a file created from outfileName.
static void writeJpegFile(java.awt.image.RenderedImage rendImage, java.io.File outfile, float compressionQuality)
          Take the RenderedImage passed in, compress it, and writes it to outfile.
static void writeJpegFile(java.awt.image.RenderedImage rendImage, java.lang.String outfileName, float compressionQuality)
          Take the RenderedImage passed in, compress it, and writes it to a file created from outfileName.
static void writePngFile(java.awt.image.RenderedImage rendImage, java.io.File outfile)
           
static void writeTifFile(java.awt.image.RenderedImage rendImage, java.io.File outfile)
           
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageTools

public ImageTools()
Method Detail

copyImage

public static void copyImage(java.awt.image.BufferedImage srcImage,
                             java.awt.image.BufferedImage destImage)
Make a copy of the BufferedImage.

Parameters:
srcImage -
destImage -

scaleAndCopyImage

public static void scaleAndCopyImage(int newWidth,
                                     int newHeight,
                                     java.awt.image.BufferedImage srcImage,
                                     java.awt.image.BufferedImage destImage)
Make a scaled copy of the BufferedImage. Uses INTERPOLATION_BILINEAR.

Parameters:
srcImage -
destImage -

writeJpegFile

public static void writeJpegFile(java.awt.image.RenderedImage rendImage,
                                 java.lang.String outfileName,
                                 float compressionQuality)
Take the RenderedImage passed in, compress it, and writes it to a file created from outfileName.

Parameters:
compressionQuality - ranges between 0 and 1, 0-lowest, 1-highest.

writePngFile

public static void writePngFile(java.awt.image.RenderedImage rendImage,
                                java.io.File outfile)

writeTifFile

public static void writeTifFile(java.awt.image.RenderedImage rendImage,
                                java.io.File outfile)

writeJpegFile

public static void writeJpegFile(java.awt.image.RenderedImage rendImage,
                                 java.io.File outfile,
                                 float compressionQuality)
Take the RenderedImage passed in, compress it, and writes it to outfile.

Parameters:
compressionQuality - ranges between 0 and 1, 0-lowest, 1-highest.

writeJpegFile

public static void writeJpegFile(java.awt.image.BufferedImage image,
                                 java.lang.String fileName,
                                 float compressionQuality,
                                 int width,
                                 int height)
Take the RenderedImage passed in, compress it, and writes it to a file created from outfileName.

Parameters:
compressionQuality - ranges between 0 and 1, 0-lowest, 1-highest.