public final class PDInlineImage extends Object implements PDImage
| Constructor and Description |
|---|
PDInlineImage(COSDictionary parameters,
byte[] data,
PDResources resources)
Creates an inline image from the given parameters and data.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
createInputStream()
Returns an InputStream containing the image data, irrespective of whether this is an
inline image or an image XObject.
|
InputStream |
createInputStream(List<String> stopFilters)
Returns an InputStream containing the image data, irrespective of whether this is an
inline image or an image XObject.
|
int |
getBitsPerComponent()
Returns bits per component of this image, or -1 if one has not been set.
|
COSArray |
getColorKeyMask()
Returns the color key mask array associated with this image, or null if
there is none.
|
PDColorSpace |
getColorSpace()
Returns the image's color space.
|
COSBase |
getCOSObject()
Convert this standard java object to a COS object.
|
byte[] |
getData()
Returns the inline image data.
|
COSArray |
getDecode()
Returns the decode array.
|
List<String> |
getFilters()
Returns a list of filters applied to this stream, or null if there are none.
|
int |
getHeight()
Returns height of this image, or -1 if one has not been set.
|
BufferedImage |
getImage()
Returns the content of this image as an AWT buffered image with an (A)RGB color space.
|
boolean |
getInterpolate()
Returns true if the image should be interpolated when rendered.
|
BufferedImage |
getStencilImage(Paint paint)
Returns an ARGB image filled with the given paint and using this image as a mask.
|
String |
getSuffix()
Returns the suffix for this image type, e.g. jpg/png.
|
int |
getWidth()
Returns the width of this image, or -1 if one has not been set.
|
boolean |
isEmpty()
Returns true if the image has no data.
|
boolean |
isStencil()
Returns true if the image is a stencil mask.
|
void |
setBitsPerComponent(int bitsPerComponent)
Set the number of bits per component.
|
void |
setColorSpace(PDColorSpace colorSpace)
Sets the color space for this image.
|
void |
setDecode(COSArray decode)
Sets the decode array.
|
void |
setFilters(List<String> filters)
Sets which filters are applied to this stream.
|
void |
setHeight(int height)
Sets the height of the image.
|
void |
setInterpolate(boolean value)
Sets the Interpolate flag, true for high-quality image scaling.
|
void |
setStencil(boolean isStencil)
Sets whether or not the image is a stencil.
|
void |
setWidth(int width)
Sets the width of the image.
|
public PDInlineImage(COSDictionary parameters, byte[] data, PDResources resources) throws IOException
parameters - the image parametersdata - the image dataresources - the current resourcesIOException - if the stream cannot be decodedpublic COSBase getCOSObject()
COSObjectablegetCOSObject in interface COSObjectablepublic int getBitsPerComponent()
PDImagegetBitsPerComponent in interface PDImagepublic void setBitsPerComponent(int bitsPerComponent)
PDImagesetBitsPerComponent in interface PDImagebitsPerComponent - The number of bits per component.public PDColorSpace getColorSpace() throws IOException
PDImagegetColorSpace in interface PDImageIOException - If there is an error getting the color space.public void setColorSpace(PDColorSpace colorSpace)
PDImagesetColorSpace in interface PDImagecolorSpace - The color space for this image.public int getHeight()
PDImagepublic void setHeight(int height)
PDImagepublic int getWidth()
PDImagepublic void setWidth(int width)
PDImagepublic boolean getInterpolate()
PDImagegetInterpolate in interface PDImagepublic void setInterpolate(boolean value)
PDImagesetInterpolate in interface PDImagepublic List<String> getFilters()
public void setFilters(List<String> filters)
filters - the filters to apply to this stream.public void setDecode(COSArray decode)
PDImagepublic COSArray getDecode()
PDImagepublic boolean isStencil()
PDImagepublic void setStencil(boolean isStencil)
PDImageImageMask entry in the image stream's dictionary.setStencil in interface PDImageisStencil - True to make the image a stencil.public InputStream createInputStream() throws IOException
PDImagecreateInputStream in interface PDImageIOException - if the data could not be read.public InputStream createInputStream(List<String> stopFilters) throws IOException
PDImagecreateInputStream in interface PDImagestopFilters - A list of filters to stop decoding at.IOException - if the data could not be read.public boolean isEmpty()
PDImagepublic byte[] getData()
public BufferedImage getImage() throws IOException
PDImagegetImage in interface PDImageIOExceptionpublic BufferedImage getStencilImage(Paint paint) throws IOException
PDImagegetStencilImage in interface PDImagepaint - the paint to fill the visible portions of the image withIOException - if the image cannot be readpublic COSArray getColorKeyMask()
Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.