Class PngImageHelper
java.lang.Object
com.itextpdf.io.image.PngImageHelper
-
Nested Class Summary
Nested Classes -
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.private static final String[]static final StringA PNG marker.static final StringA PNG marker.private static final intprivate static final intprivate static final intprivate static final intprivate static final intstatic final int[]Some PNG specific values.static final StringA PNG marker.private static final intstatic final StringA PNG marker. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanprivate static voiddecodeAverageFilter(byte[] curr, byte[] prev, int count, int bpp) private static voidprivate static voiddecodePaethFilter(byte[] curr, byte[] prev, int count, int bpp) private static voiddecodePass(int xOffset, int yOffset, int xStep, int yStep, int passWidth, int passHeight, PngImageHelper.PngParameters png) private static voiddecodeSubFilter(byte[] curr, int count, int bpp) private static voiddecodeUpFilter(byte[] curr, byte[] prev, int count) private static intstatic intgetInt(InputStream pngStream) Gets anintfrom anInputStream.private static intgetPixel(byte[] image, int x, int y, int bitDepth, int bytesPerRow) private static int[]getPixel(byte[] curr, PngImageHelper.PngParameters png) static StringgetString(InputStream pngStream) Gets aStringfrom anInputStream.static intgetWord(InputStream pngStream) Gets awordfrom anInputStream.private static intpaethPredictor(int a, int b, int c) static voidprocessImage(ImageData image) private static voidprocessPixels(byte[] curr, int xOffset, int step, int y, int width, PngImageHelper.PngParameters png) private static voidprocessPng(InputStream pngStream, PngImageHelper.PngParameters png) private static voidreadPng(InputStream pngStream, PngImageHelper.PngParameters png) (package private) static voidsetPixel(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
-
PLTE
-
IDAT
-
IEND
-
tRNS
-
pHYs
-
gAMA
-
cHRM
-
sRGB
-
iCCP
-
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 anintfrom anInputStream.- Parameters:
pngStream- anInputStream- Returns:
- the value of an
int - Throws:
IOException
-
getWord
Gets awordfrom anInputStream.- Parameters:
pngStream- anInputStream- Returns:
- the value of an
int - Throws:
IOException
-
getString
Gets aStringfrom anInputStream.- Parameters:
pngStream- anInputStream- Returns:
- the value of an
int - Throws:
IOException
-