Package com.itextpdf.io.image
Class PngImageHelper
java.lang.Object
com.itextpdf.io.image.PngImageHelper
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
A PNG marker.static final String
A PNG marker.static final String
A PNG marker.static final String
A PNG marker.static final String
A PNG marker.static final String
A PNG marker.private static final String[]
static final String
A PNG marker.static final String
A PNG marker.private static final int
private static final int
private static final int
private static final int
private static final int
static final int[]
Some PNG specific values.static final String
A PNG marker.private static final int
static final String
A PNG marker. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
private static void
decodeAverageFilter
(byte[] curr, byte[] prev, int count, int bpp) private static void
private static void
decodePaethFilter
(byte[] curr, byte[] prev, int count, int bpp) private static void
decodePass
(int xOffset, int yOffset, int xStep, int yStep, int passWidth, int passHeight, PngImageHelper.PngParameters png) private static void
decodeSubFilter
(byte[] curr, int count, int bpp) private static void
decodeUpFilter
(byte[] curr, byte[] prev, int count) private static int
static int
getInt
(InputStream pngStream) Gets anint
from anInputStream
.private static int
getPixel
(byte[] image, int x, int y, int bitDepth, int bytesPerRow) private static int[]
getPixel
(byte[] curr, PngImageHelper.PngParameters png) static String
getString
(InputStream pngStream) Gets aString
from anInputStream
.static int
getWord
(InputStream pngStream) Gets aword
from anInputStream
.private static int
paethPredictor
(int a, int b, int c) static void
processImage
(ImageData image) private static void
processPixels
(byte[] curr, int xOffset, int step, int y, int width, PngImageHelper.PngParameters png) private static void
processPng
(InputStream pngStream, PngImageHelper.PngParameters png) private static void
readPng
(InputStream pngStream, PngImageHelper.PngParameters png) (package private) static void
setPixel
(byte[] image, int[] data, int offset, int size, int x, int y, int bitDepth, int bytesPerRow)
-
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:
-
TRANSFERSIZE
private static final int TRANSFERSIZE- See Also:
-
PNG_FILTER_NONE
private static final int PNG_FILTER_NONE- See Also:
-
PNG_FILTER_SUB
private static final int PNG_FILTER_SUB- See Also:
-
PNG_FILTER_UP
private static final int PNG_FILTER_UP- See Also:
-
PNG_FILTER_AVERAGE
private static final int PNG_FILTER_AVERAGE- See Also:
-
PNG_FILTER_PAETH
private static final int PNG_FILTER_PAETH- See Also:
-
intents
-
-
Constructor Details
-
PngImageHelper
PngImageHelper()
-
-
Method Details
-
processImage
-
processPng
private static void processPng(InputStream pngStream, PngImageHelper.PngParameters png) throws IOException - Throws:
IOException
-
getExpectedNumberOfColorComponents
-
readPng
private static void readPng(InputStream pngStream, PngImageHelper.PngParameters png) throws IOException - Throws:
IOException
-
checkMarker
-
decodeIdat
-
decodePass
private static void decodePass(int xOffset, int yOffset, int xStep, int yStep, int passWidth, int passHeight, PngImageHelper.PngParameters png) -
processPixels
private static void processPixels(byte[] curr, int xOffset, int step, int y, int width, PngImageHelper.PngParameters png) -
getPixel
private static int getPixel(byte[] image, int x, int y, int bitDepth, int bytesPerRow) -
setPixel
static void setPixel(byte[] image, int[] data, int offset, int size, int x, int y, int bitDepth, int bytesPerRow) -
getPixel
-
decodeSubFilter
private static void decodeSubFilter(byte[] curr, int count, int bpp) -
decodeUpFilter
private static void decodeUpFilter(byte[] curr, byte[] prev, int count) -
decodeAverageFilter
private static void decodeAverageFilter(byte[] curr, byte[] prev, int count, int bpp) -
paethPredictor
private static int paethPredictor(int a, int b, int c) -
decodePaethFilter
private static void decodePaethFilter(byte[] curr, byte[] prev, int count, int bpp) -
getInt
Gets anint
from anInputStream
.- Parameters:
pngStream
- anInputStream
- Returns:
- the value of an
int
- Throws:
IOException
-
getWord
Gets aword
from anInputStream
.- Parameters:
pngStream
- anInputStream
- Returns:
- the value of an
int
- Throws:
IOException
-
getString
Gets aString
from anInputStream
.- Parameters:
pngStream
- anInputStream
- Returns:
- the value of an
int
- Throws:
IOException
-