public interface PDImage extends COSObjectable
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.
|
PDColorSpace |
getColorSpace()
Returns the image's color space.
|
COSArray |
getDecode()
Returns the decode array.
|
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.
|
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 |
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.
|
getCOSObject
BufferedImage getImage() throws IOException
IOException
BufferedImage getStencilImage(Paint paint) throws IOException
paint
- the paint to fill the visible portions of the image withIOException
- if the image cannot be readIllegalStateException
- if the image is not a stencil.InputStream createInputStream() throws IOException
IOException
- if the data could not be read.InputStream createInputStream(List<String> stopFilters) throws IOException
IOException
- if the data could not be read.boolean isEmpty()
boolean isStencil()
void setStencil(boolean isStencil)
ImageMask
entry in the image stream's dictionary.isStencil
- True to make the image a stencil.int getBitsPerComponent()
void setBitsPerComponent(int bitsPerComponent)
bitsPerComponent
- The number of bits per component.PDColorSpace getColorSpace() throws IOException
IOException
- If there is an error getting the color space.void setColorSpace(PDColorSpace colorSpace)
colorSpace
- The color space for this image.int getHeight()
void setHeight(int height)
height
- The height of the image.int getWidth()
void setWidth(int width)
width
- The width of the image.void setDecode(COSArray decode)
decode
- the new decode array.COSArray getDecode()
boolean getInterpolate()
void setInterpolate(boolean value)
String getSuffix()
Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.