## com.bbn.openmap.image
Class PPMFormatter

    java.lang.Object
      com.bbn.openmap.image.AbstractImageFormatter
          com.bbn.openmap.image.PPMFormatter

All Implemented Interfaces:
  java.util.EventListener, ImageFormatter, java.beans.PropertyChangeListener, PropertyConsumer

public class PPMFormatter
extends AbstractImageFormatter

A simple formatter to create PPM images.

I got a simple definition of a PPM image an wrote something to make that. XV complains about the P3 image, but still draws it. No complaints for the P6.

Field Summary
`static int` `HEADER_BUFFER_SIZE`
`static int` `MAX_COLOR_VALUE`
`protected boolean` `rawbits`
`static java.lang.String` `rawbitsMagicNumber`
`static java.lang.String` `RawBitsProperty`
`static java.lang.String` `regularMagicNumber`

Fields inherited from class com.bbn.openmap.image.AbstractImageFormatter
`bufferedImage, layers, propertiesPrefix`

Fields inherited from interface com.bbn.openmap.PropertyConsumer
`EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty`

Constructor Summary
`PPMFormatter()`

Method Summary
`byte[]` `formatImage(java.awt.image.BufferedImage bi)` Convert a BufferedImage to a image file format...
`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.
`boolean` `getRawbits()`
`ImageFormatter` `makeClone()` Create a new instance of the same type of formatter.
`void` `setProperties(java.lang.String prefix, java.util.Properties props)` Set the properties of the image formatter.
`void` `setRawbits(boolean rb)`

Methods inherited from class com.bbn.openmap.image.AbstractImageFormatter
`getBufferedImage, getGraphics, getGraphics, getImageBytes, getImageFromMapBean, getImageFromMapBean, getImageFromMapBean, getProperties, getPropertyInfo, getPropertyPrefix, getScaledBufferedImage, getScaledImageBytes, propertyChange, setBufferedImage, setProperties, setPropertyPrefix`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### RawBitsProperty

    public static final java.lang.String RawBitsProperty

See Also:
  Constant Field Values

### regularMagicNumber

    public static final java.lang.String regularMagicNumber

See Also:
  Constant Field Values

### rawbitsMagicNumber

    public static final java.lang.String rawbitsMagicNumber

See Also:
  Constant Field Values

### HEADER_BUFFER_SIZE

    public static final int HEADER_BUFFER_SIZE

See Also:
  Constant Field Values

### MAX_COLOR_VALUE

    public static final int MAX_COLOR_VALUE

See Also:
  Constant Field Values

### rawbits

    protected boolean rawbits

Constructor Detail

### PPMFormatter

    public PPMFormatter()

Method Detail

### setProperties

    public void setProperties(java.lang.String prefix,
                              java.util.Properties props)

  Description copied from class: `AbstractImageFormatter`
  Set the properties of the image formatter.

  Specified by:
    `setProperties` in interface `ImageFormatter`
  Overrides:
    `setProperties` in class `AbstractImageFormatter`

### makeClone

    public ImageFormatter makeClone()

  Description copied from class: `AbstractImageFormatter`
  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.

  Specified by:
    `makeClone` in interface `ImageFormatter`
  Specified by:
    `makeClone` in class `AbstractImageFormatter`
  Returns:
    a new instance of this type of formatter, with the same properties set.

### getRawbits

    public boolean getRawbits()

### setRawbits

    public void setRawbits(boolean rb)

### formatImage

    public byte[] formatImage(java.awt.image.BufferedImage bi)

  Description copied from class: `AbstractImageFormatter`
  Convert a BufferedImage to a image file format...

  Specified by:
    `formatImage` in interface `ImageFormatter`
  Specified by:
    `formatImage` in class `AbstractImageFormatter`
  Parameters:
    `bi` - a BufferedImage..

### getFormatLabel

    public 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

    public java.lang.String getContentType()

  Description copied from interface: `ImageFormatter`
  Get the Mime Content Type created by the ImageFormatter.

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