org.pdfbox.pdmodel.graphics.xobject
Class PDPixelMap

java.lang.Object
  extended byorg.pdfbox.pdmodel.graphics.xobject.PDXObject
      extended byorg.pdfbox.pdmodel.graphics.xobject.PDXObjectImage
          extended byorg.pdfbox.pdmodel.graphics.xobject.PDPixelMap
All Implemented Interfaces:
COSObjectable

public class PDPixelMap
extends PDXObjectImage

This class contains a PixelMap Image.

Version:
$Revision: 1.7 $
Author:
Ben Litchfield (ben@benlitchfield.com), mathiak

Field Summary
 
Fields inherited from class org.pdfbox.pdmodel.graphics.xobject.PDXObjectImage
SUB_TYPE
 
Constructor Summary
PDPixelMap(PDStream pdStream)
          Standard constructor.
 
Method Summary
 COSDictionary getDecodeParams()
          DecodeParms is an optional parameter for filters.
 int getPredictor()
          A code that selects the predictor algorithm.
 BufferedImage getRGBImage()
          Returns a BufferedImage of the COSStream set in the constructor or null if the COSStream could not be encoded.
 void write2OutputStream(OutputStream out)
          Writes the image as .png.
 
Methods inherited from class org.pdfbox.pdmodel.graphics.xobject.PDXObjectImage
getBitsPerComponent, getColorSpace, getHeight, getSuffix, getWidth, setBitsPerComponent, setColorSpace, setHeight, setWidth, write2file
 
Methods inherited from class org.pdfbox.pdmodel.graphics.xobject.PDXObject
createXObject, getCOSObject, getCOSStream, getMetadata, getPDStream, setMetadata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDPixelMap

public PDPixelMap(PDStream pdStream)
Standard constructor. Basically does nothing.

Parameters:
pdStream - The stream that holds the pixel map.
Method Detail

getRGBImage

public BufferedImage getRGBImage()
                          throws IOException
Returns a BufferedImage of the COSStream set in the constructor or null if the COSStream could not be encoded.

Specified by:
getRGBImage in class PDXObjectImage
Returns:
This PDF object as an AWT image.
Throws:
IOException - If there is an error creating the image.
See Also:
PDXObjectImage.getRGBImage()

write2OutputStream

public void write2OutputStream(OutputStream out)
                        throws IOException
Writes the image as .png.

Specified by:
write2OutputStream in class PDXObjectImage
Parameters:
out - the OutputStream that the Image is written to.
Throws:
IOException - when somethings wrong with out
See Also:
PDXObjectImage.write2OutputStream(java.io.OutputStream)

getDecodeParams

public COSDictionary getDecodeParams()
DecodeParms is an optional parameter for filters. It is provided if any of the filters has nondefault parameters. If there is only one filter it is a dictionary, if there are multiple filters it is an array with an entry for each filter. An array entry can hold a null value if only the default values are used or a dictionary with parameters.

Returns:
The decoding parameters.

getPredictor

public int getPredictor()
A code that selects the predictor algorithm. Default value: 1.

Returns:
predictor algorithm code