Package com.lowagie.text.pdf.codec
Class PngImage
java.lang.Object
com.lowagie.text.pdf.codec.PngImage
Reads a PNG image. All types of PNG can be read.
It is based in part in the JAI codec.
- Author:
- Paulo Soares (psoares@consiste.pt)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA PNG marker.static final StringA PNG marker.static final StringA PNG marker.static final StringA PNG marker.static final StringA PNG marker.static final StringA PNG marker.static final StringA PNG marker.static final StringA PNG marker.static final int[]Some PNG specific values.static final StringA PNG marker.static final StringA PNG marker. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImagegetImage(byte[] data) Reads a PNG from a byte array.static ImagegetImage(InputStream is) Reads a PNG from a stream.static ImageReads a PNG from a file.static ImageReads a PNG from an url.static final intgetInt(InputStream is) Gets anintfrom anInputStream.static final StringgetString(InputStream is) Gets aStringfrom anInputStream.static final intgetWord(InputStream is) Gets awordfrom anInputStream.
-
Field Details
-
PNGID
public static final int[] PNGIDSome PNG specific values. -
IHDR
A PNG marker.- See Also:
-
PLTE
A PNG marker.- See Also:
-
IDAT
A PNG marker.- See Also:
-
IEND
A PNG marker.- See Also:
-
tRNS
A PNG marker.- See Also:
-
pHYs
A PNG marker.- See Also:
-
gAMA
A PNG marker.- See Also:
-
cHRM
A PNG marker.- See Also:
-
sRGB
A PNG marker.- See Also:
-
iCCP
A PNG marker.- See Also:
-
-
Method Details
-
getImage
Reads a PNG from an url.- Parameters:
url- the url- Returns:
- the image
- Throws:
IOException- on error
-
getImage
Reads a PNG from a stream.- Parameters:
is- the stream- Returns:
- the image
- Throws:
IOException- on error
-
getImage
Reads a PNG from a file.- Parameters:
file- the file- Returns:
- the image
- Throws:
IOException- on error
-
getImage
Reads a PNG from a byte array.- Parameters:
data- the byte array- Returns:
- the image
- Throws:
IOException- on error
-
getInt
Gets anintfrom anInputStream.- Parameters:
is- anInputStream- Returns:
- the value of an
int - Throws:
IOException
-
getWord
Gets awordfrom anInputStream.- Parameters:
is- anInputStream- Returns:
- the value of an
int - Throws:
IOException
-
getString
Gets aStringfrom anInputStream.- Parameters:
is- anInputStream- Returns:
- the value of an
int - Throws:
IOException
-