Class PDFImage
java.lang.Object
com.sun.pdfview.PDFImage
Encapsulates a PDF Image
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PDFImagecreateImage(PDFObject obj, Map resources) Read a PDFImage from an image dictionary and streamstatic voidprotected intGet the number of bits per component sampleprotected PDFColorSpaceGet the colorspace associated with this image, or null if there isn't oneprotected float[]Get the decode arrayintGet the image's heightgetImage()Get the image that this PDFImage generates.getSMask()Return the soft mask associated with this imageintgetWidth()Get the image's widthbooleanReturn whether or not this is an image maskstatic voidprotected BufferedImageparseData(byte[] data) Parse the image stream into a buffered image.protected voidsetBitsPerComponent(int bpc) Set the number of bits per component sampleprotected voidsetColorSpace(PDFColorSpace colorSpace) Set the colorspace associated with this imageprotected voidsetDecode(float[] decode) Set the decode arrayprotected voidsetHeight(int height) Set the image's heightvoidsetImageMask(boolean imageMask) Set whether or not this is an image maskprotected voidSet the soft mask imageprotected voidsetWidth(int width) Set the image's width
-
Constructor Details
-
PDFImage
Create an instance of a PDFImage
-
-
Method Details
-
dump
- Throws:
IOException
-
p
-
createImage
Read a PDFImage from an image dictionary and stream- Parameters:
obj- the PDFObject containing the image's dictionary and streamresources- the current resources- Throws:
IOException
-
getImage
Get the image that this PDFImage generates.- Returns:
- a buffered image containing the decoded image data
-
parseData
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.
NOTE: the color convolving is extremely slow on large images. It would be good to see if it could be moved out into the rendering phases, where we might be able to scale the image down first.invalid input: '<'/p
-
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
Get the colorspace associated with this image, or null if there isn't one -
setColorSpace
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
Return the soft mask associated with this image -
setSMask
Set the soft mask image -
getDecode
protected float[] getDecode()Get the decode array -
setDecode
protected void setDecode(float[] decode) Set the decode array
-