COSObjectable
PDImageXObject
, PDInlineImage
public interface PDImage extends COSObjectable
Modifier and Type | Method | Description |
---|---|---|
java.io.InputStream |
createInputStream() |
Returns an InputStream containing the image data, irrespective of whether this is an
inline image or an image XObject.
|
java.io.InputStream |
createInputStream(java.util.List<java.lang.String> stopFilters) |
Returns an InputStream containing the image data, irrespective of whether this is an
inline image or an image XObject.
|
java.io.InputStream |
createInputStream(DecodeOptions options) |
Returns an InputStream, passing additional options to each filter
|
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.
|
java.awt.image.BufferedImage |
getImage() |
Returns the content of this image as an AWT buffered image with an (A)RGB color space.
|
java.awt.image.BufferedImage |
getImage(java.awt.Rectangle region,
int subsampling) |
Returns the content of this image as an AWT buffered image with an (A)RGB colored space.
|
boolean |
getInterpolate() |
Returns true if the image should be interpolated when rendered.
|
java.awt.image.BufferedImage |
getStencilImage(java.awt.Paint paint) |
Returns an ARGB image filled with the given paint and using this image as a mask.
|
java.lang.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
java.awt.image.BufferedImage getImage() throws java.io.IOException
java.io.IOException
java.awt.image.BufferedImage getImage(java.awt.Rectangle region, int subsampling) throws java.io.IOException
the unparameterized version
, this method does not
cache the resulting image.region
- The region of the source image to get, or null if the entire image is needed.
The actual region will be clipped to the dimensions of the source image.subsampling
- The amount of rows and columns to advance for every output pixel, a value
of 1 meaning every pixel will be readjava.io.IOException
java.awt.image.BufferedImage getStencilImage(java.awt.Paint paint) throws java.io.IOException
paint
- the paint to fill the visible portions of the image withjava.io.IOException
- if the image cannot be readjava.lang.IllegalStateException
- if the image is not a stencil.java.io.InputStream createInputStream() throws java.io.IOException
java.io.IOException
- if the data could not be read.java.io.InputStream createInputStream(java.util.List<java.lang.String> stopFilters) throws java.io.IOException
stopFilters
- A list of filters to stop decoding at.java.io.IOException
- if the data could not be read.java.io.InputStream createInputStream(DecodeOptions options) throws java.io.IOException
options
- Additional decoding options passed to the filters usedjava.io.IOException
- if the data could not be readboolean 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 java.io.IOException
java.io.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)
java.lang.String getSuffix()
Copyright © 2002–2018. All rights reserved.