public class PdfImageObject extends Object
Modifier and Type | Field and Description |
---|---|
private int |
bpc |
private boolean |
decoded |
private PdfDictionary |
dictionary
The image dictionary.
|
protected String |
fileType |
private int |
height |
private byte[] |
icc |
private byte[] |
palette |
private int |
pngBitDepth |
private int |
pngColorType |
private byte[] |
streamBytes
The decoded image bytes (after applying filters), or the raw image bytes if unable to decode
|
private int |
stride |
static String |
TYPE_JP2 |
static String |
TYPE_JPG |
static String |
TYPE_PNG |
static String |
TYPE_TIF |
private int |
width |
Modifier | Constructor and Description |
---|---|
protected |
PdfImageObject(PdfDictionary dictionary,
byte[] samples)
Creats a PdfImage object using an explicitly provided dictionary and image bytes
|
|
PdfImageObject(PRStream stream)
Creates a PdfImage object.
|
Modifier and Type | Method and Description |
---|---|
private void |
findColorspace(PdfObject colorspace,
boolean allowIndexed) |
PdfObject |
get(PdfName key)
Returns an entry from the image dictionary.
|
BufferedImage |
getBufferedImage() |
PdfDictionary |
getDictionary()
Returns the image dictionary.
|
String |
getFileType() |
byte[] |
getImageAsBytes() |
byte[] |
getStreamBytes()
Returns the image bytes.
|
private PdfDictionary dictionary
private byte[] streamBytes
private int pngColorType
private int pngBitDepth
private int width
private int height
private int bpc
private byte[] palette
private byte[] icc
private int stride
private boolean decoded
public static final String TYPE_PNG
public static final String TYPE_JPG
public static final String TYPE_JP2
public static final String TYPE_TIF
public PdfImageObject(PRStream stream) throws IOException
stream
- a PRStreamIOException
protected PdfImageObject(PdfDictionary dictionary, byte[] samples) throws IOException
dictionary
- the dictionary for the imagesamples
- the samplesIOException
public String getFileType()
public PdfObject get(PdfName key)
key
- a keypublic PdfDictionary getDictionary()
public byte[] getStreamBytes()
private void findColorspace(PdfObject colorspace, boolean allowIndexed) throws IOException
IOException
public byte[] getImageAsBytes() throws IOException
IOException
public BufferedImage getBufferedImage() throws IOException
IOException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses