## com.sun.pdfview
Class PDFImage

    java.lang.Object
      com.sun.pdfview.PDFImage

    public class PDFImage

extends java.lang.Object

Encapsulates a PDF Image

Constructor Summary
`protected` `PDFImage(PDFObject imageObj)` Create an instance of a PDFImage

Method Summary
`static PDFImage` `createImage(PDFObject obj, java.util.Map resources)` Read a PDFImage from an image dictionary and stream
`protected int` `getBitsPerComponent()` Get the number of bits per component sample
`protected PDFColorSpace` `getColorSpace()` Get the colorspace associated with this image, or null if there isn't one
`protected float[]` `getDecode()` Get the decode array
`int` `getHeight()` Get the image's height
`java.awt.image.BufferedImage` `getImage()` Get the image that this PDFImage generates.
`PDFImage` `getSMask()` Return the soft mask associated with this image
`int` `getWidth()` Get the image's width
`boolean` `isImageMask()` Return whether or not this is an image mask
`protected java.awt.image.BufferedImage` `parseData(byte[] data)` Parse the image stream into a buffered image.
`protected void` `setBitsPerComponent(int bpc)` Set the number of bits per component sample
`protected void` `setColorSpace(PDFColorSpace colorSpace)` Set the colorspace associated with this image
`protected void` `setDecode(float[] decode)` Set the decode array
`protected void` `setHeight(int height)` Set the image's height
`void` `setImageMask(boolean imageMask)` Set whether or not this is an image mask
`protected void` `setSMask(PDFImage sMask)` Set the soft mask image
`protected void` `setWidth(int width)` Set the image's width

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

Constructor Detail

### PDFImage

    protected PDFImage(PDFObject imageObj)

  Create an instance of a PDFImage

Method Detail

### createImage

    public static PDFImage createImage(PDFObject obj,
                                       java.util.Map resources)
                                throws java.io.IOException

  Read a PDFImage from an image dictionary and stream

  Parameters:
    `obj` - the PDFObject containing the image's dictionary and stream
    `resources` - the current resources
  Throws:
    `java.io.IOException`

### getImage

    public java.awt.image.BufferedImage getImage()

  Get the image that this PDFImage generates.

  Returns:
    a buffered image containing the decoded image data

### parseData

    protected java.awt.image.BufferedImage parseData(byte[] data)

  Parse the image stream into a buffered image. Note that this is guaranteed to be called after all the other setXXX methods have been called.

### getWidth

    public int getWidth()

  Get the image's width

### setWidth

    protected void setWidth(int width)

  Set the image's width

### getHeight

    public int getHeight()

  Get the image's height

### setHeight

    protected void setHeight(int height)

  Set the image's height

### getColorSpace

    protected PDFColorSpace getColorSpace()

  Get the colorspace associated with this image, or null if there isn't one

### setColorSpace

    protected void setColorSpace(PDFColorSpace colorSpace)

  Set the colorspace associated with this image

### getBitsPerComponent

    protected int getBitsPerComponent()

  Get the number of bits per component sample

### setBitsPerComponent

    protected void setBitsPerComponent(int bpc)

  Set the number of bits per component sample

### isImageMask

    public boolean isImageMask()

  Return whether or not this is an image mask

### setImageMask

    public void setImageMask(boolean imageMask)

  Set whether or not this is an image mask

### getSMask

    public PDFImage getSMask()

  Return the soft mask associated with this image

### setSMask

    protected void setSMask(PDFImage sMask)

  Set the soft mask image

### getDecode

    protected float[] getDecode()

  Get the decode array

### setDecode

    protected void setDecode(float[] decode)

  Set the decode array