org.newdawn.slick.imageout
Class ImageOut

java.lang.Object
  extended by org.newdawn.slick.imageout.ImageOut

public class ImageOut
extends java.lang.Object

A static hook to access all the Image output utilities. The list of format strings provided is not the limit of capability. These are provided for utility, use @see getSupportedFormats() for a full list of supported formats.

Author:
kevin

Field Summary
static java.lang.String JPG
          The format string for JPG
static java.lang.String PNG
          The format string for PNG
static java.lang.String TGA
          The format string for TGA
 
Constructor Summary
ImageOut()
           
 
Method Summary
static java.lang.String[] getSupportedFormats()
          Get a list of supported formats
static void write(Image image, java.lang.String dest)
          Write an image out to a file on the local file system.
static void write(Image image, java.lang.String dest, boolean writeAlpha)
          Write an image out to a file on the local file system.
static void write(Image image, java.lang.String format, java.io.OutputStream out)
          Write an image out to a specified output stream
static void write(Image image, java.lang.String format, java.io.OutputStream out, boolean writeAlpha)
          Write an image out to a specified output stream
static void write(Image image, java.lang.String format, java.lang.String dest)
          Write an image out to a file on the local file system.
static void write(Image image, java.lang.String format, java.lang.String dest, boolean writeAlpha)
          Write an image out to a file on the local file system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TGA

public static java.lang.String TGA
The format string for TGA


PNG

public static java.lang.String PNG
The format string for PNG


JPG

public static java.lang.String JPG
The format string for JPG

Constructor Detail

ImageOut

public ImageOut()
Method Detail

getSupportedFormats

public static java.lang.String[] getSupportedFormats()
Get a list of supported formats

Returns:
The list of supported format strings
See Also:
ImageWriterFactory.getSupportedFormats()

write

public static void write(Image image,
                         java.lang.String format,
                         java.io.OutputStream out)
                  throws SlickException
Write an image out to a specified output stream

Parameters:
image - The image to write out to
format - The format to write the image out in
out - The output stream to which the image should be written
Throws:
SlickException - Indicates a failure to write the image in the specified format

write

public static void write(Image image,
                         java.lang.String format,
                         java.io.OutputStream out,
                         boolean writeAlpha)
                  throws SlickException
Write an image out to a specified output stream

Parameters:
image - The image to write out to
format - The format to write the image out in
out - The output stream to which the image should be written
writeAlpha - True if we should write the alpha channel out (some formats don't support this, like JPG)
Throws:
SlickException - Indicates a failure to write the image in the specified format

write

public static void write(Image image,
                         java.lang.String dest)
                  throws SlickException
Write an image out to a file on the local file system. The format of the output is determined based on the file name extension

Parameters:
image - The image to be written out
dest - The destination path to write to
Throws:
SlickException - Indicates a failure to write the image in the determined format

write

public static void write(Image image,
                         java.lang.String dest,
                         boolean writeAlpha)
                  throws SlickException
Write an image out to a file on the local file system. The format of the output is determined based on the file name extension

Parameters:
image - The image to be written out
dest - The destination path to write to
writeAlpha - True if we should write the alpha channel out (some formats don't support this, like JPG)
Throws:
SlickException - Indicates a failure to write the image in the determined format

write

public static void write(Image image,
                         java.lang.String format,
                         java.lang.String dest)
                  throws SlickException
Write an image out to a file on the local file system.

Parameters:
image - The image to be written out
format - The format to write the image out in
dest - The destination path to write to
Throws:
SlickException - Indicates a failure to write the image in the determined format

write

public static void write(Image image,
                         java.lang.String format,
                         java.lang.String dest,
                         boolean writeAlpha)
                  throws SlickException
Write an image out to a file on the local file system.

Parameters:
image - The image to be written out
format - The format to write the image out in
dest - The destination path to write to
writeAlpha - True if we should write the alpha channel out (some formats don't support this, like JPG)
Throws:
SlickException - Indicates a failure to write the image in the determined format


Copyright © 2006 New Dawn Software. All Rights Reserved.