deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.framework.util
Class ImageUtils

java.lang.Object
  extended by org.deegree.framework.util.ImageUtils

public class ImageUtils
extends Object

Some utility methods for reading standard images

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $

Constructor Summary
ImageUtils()
           
 
Method Summary
static void encodeGif(OutputStream out, BufferedImage img)
           
static BufferedImage loadImage(File file)
          reads an image from the passed file location using JAI mechanism
static BufferedImage loadImage(InputStream is)
          reads an image from the passed InputStream using JAI mechanism
static BufferedImage loadImage(String fileName)
          reads an image from the passed file location using JAI mechanism
static BufferedImage loadImage(URL url)
          reads an image from the passed URL using JAI mechanism
static void saveImage(BufferedImage image, File file, float quality)
          stores the passed image in the passed file with defined quality
static void saveImage(BufferedImage image, OutputStream os, String format, float quality)
          write an image into the passed output stream. after writing the image the stream will be closed.
static void saveImage(BufferedImage image, String fileName, float quality)
          stores the passed image in the passed file name with defined quality
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtils

public ImageUtils()
Method Detail

loadImage

public static BufferedImage loadImage(URL url)
                               throws IOException
reads an image from the passed URL using JAI mechanism

Parameters:
url - address of the image
Returns:
read image
Throws:
IOException

loadImage

public static BufferedImage loadImage(InputStream is)
                               throws IOException
reads an image from the passed InputStream using JAI mechanism

Parameters:
is -
Returns:
read image
Throws:
IOException

loadImage

public static BufferedImage loadImage(String fileName)
                               throws IOException
reads an image from the passed file location using JAI mechanism

Parameters:
fileName -
Returns:
read imagey
Throws:
IOException

loadImage

public static BufferedImage loadImage(File file)
                               throws IOException
reads an image from the passed file location using JAI mechanism

Parameters:
file -
Returns:
read image
Throws:
IOException

saveImage

public static void saveImage(BufferedImage image,
                             String fileName,
                             float quality)
                      throws IOException
stores the passed image in the passed file name with defined quality

Parameters:
image -
fileName -
quality - just supported for jpeg (0..1)
Throws:
IOException

saveImage

public static void saveImage(BufferedImage image,
                             File file,
                             float quality)
                      throws IOException
stores the passed image in the passed file with defined quality

Parameters:
image -
file -
quality - just supported for jpeg (0..1)
Throws:
IOException

saveImage

public static void saveImage(BufferedImage image,
                             OutputStream os,
                             String format,
                             float quality)
                      throws IOException
write an image into the passed output stream. after writing the image the stream will be closed.

Parameters:
image -
os -
format -
quality -
Throws:
IOException

encodeGif

public static void encodeGif(OutputStream out,
                             BufferedImage img)
                      throws IOException
Parameters:
out -
img -
Throws:
IOException

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org