com.bbn.openmap.image
Interface ImageFormatter

All Known Implementing Classes:
AbstractImageFormatter, AcmeGifFormatter, GIFImageIOFormatter, ImageIOFormatter, PNG32ImageFormatter, PNG8ImageFormatter, PNGImageIOFormatter, PPMFormatter, SunJPEGFormatter

public interface ImageFormatter

The ImageFormatter deals with most of the image meanderings of Java, while letting you create an image in a specific format.


Method Summary
 byte[] formatImage(java.awt.image.BufferedImage bi)
          Convert a BufferedImage to a image file format...
 java.awt.image.BufferedImage getBufferedImage()
          Return the BufferedImage contained within the formatter.
 java.lang.String getContentType()
          Get the Mime Content Type created by the ImageFormatter.
 java.lang.String getFormatLabel()
          Get the Image Type created by the ImageFormatter.
 java.awt.Graphics getGraphics(int width, int height)
          Return the applicable Graphics to use to paint the layers into.
 java.awt.Graphics getGraphics(int width, int height, boolean alpha)
           
 byte[] getImageBytes()
          Return the image bytes of the formatted image.
 byte[] getImageFromMapBean(MapBean map)
          Take a MapBean, and get the image bytes that represent the current state.
 java.awt.image.BufferedImage getScaledBufferedImage(int scaledWidth, int scaledHeight)
          Scale the internal BufferedImage to the pixel dimensions, and then return it.
 byte[] getScaledImageBytes(int scaledWidth, int scaledHeight)
          Scale the internal BufferedImage, then return the image bytes of the formatted image.
 ImageFormatter makeClone()
          Create a new instance of the same type of formatter.
 void setBufferedImage(java.awt.image.BufferedImage bi)
          Return the BufferedImage contained within the formatter.
 void setProperties(java.lang.String prefix, java.util.Properties props)
          Set the properties of the image formatter.
 

Method Detail

setProperties

void setProperties(java.lang.String prefix,
                   java.util.Properties props)
Set the properties of the image formatter.


makeClone

ImageFormatter makeClone()
Create a new instance of the same type of formatter. If you are running in a multi-threaded environment, you'll need to provide a new instance of the formatter to each thread, since the image and graphics that are being drawn into for each thread are contained within.

Returns:
a new instance of this type of formatter, with the same properties set.

formatImage

byte[] formatImage(java.awt.image.BufferedImage bi)
Convert a BufferedImage to a image file format...

Parameters:
bi - a BufferedImage..

getImageFromMapBean

byte[] getImageFromMapBean(MapBean map)
Take a MapBean, and get the image bytes that represent the current state.

Parameters:
map - the MapBean.
Returns:
byte[] representing an image of the map in it's current state.

getGraphics

java.awt.Graphics getGraphics(int width,
                              int height)
Return the applicable Graphics to use to paint the layers into. If the internal BufferedImage hasn't been created yet, or has been set to null, then a new buffered Image is created, set to the size specified by the height and width given. The ImageGenerator extends MapBean. Remember to dispose of the graphics object when you are done with it.

Parameters:
width - pixel width of Graphics.
height - pixel height of Graphics.
Returns:
java.awt.Graphics object to use.

getGraphics

java.awt.Graphics getGraphics(int width,
                              int height,
                              boolean alpha)

getBufferedImage

java.awt.image.BufferedImage getBufferedImage()
Return the BufferedImage contained within the formatter.

Returns:
the BufferedImage.

setBufferedImage

void setBufferedImage(java.awt.image.BufferedImage bi)
Return the BufferedImage contained within the formatter.

Parameters:
bi - the BufferedImage to use in this formatter.

getScaledBufferedImage

java.awt.image.BufferedImage getScaledBufferedImage(int scaledWidth,
                                                    int scaledHeight)
Scale the internal BufferedImage to the pixel dimensions, and then return it.

Parameters:
scaledWidth - the desired pixel width of the image.
scaledHeight - the desired pixel height of the image.
Returns:
the scaled BufferedImage.

getImageBytes

byte[] getImageBytes()
Return the image bytes of the formatted image.

Returns:
byte[] representing the image.

getScaledImageBytes

byte[] getScaledImageBytes(int scaledWidth,
                           int scaledHeight)
Scale the internal BufferedImage, then return the image bytes of the formatted image.

Parameters:
scaledWidth - the desired pixel width of the image.
scaledHeight - the desired pixel height of the image.
Returns:
byte[] representing the image.

getFormatLabel

java.lang.String getFormatLabel()
Get the Image Type created by the ImageFormatter. These responses should adhere to the OGC WMT standard format labels. Some are listed in the WMTConstants interface file.


getContentType

java.lang.String getContentType()
Get the Mime Content Type created by the ImageFormatter.



Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details