Package com.itextpdf.io.image
Class PngImageHelper
- java.lang.Object
-
- com.itextpdf.io.image.PngImageHelper
-
class PngImageHelper extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPngImageHelper.PngParameters
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringcHRMA PNG marker.static java.lang.StringgAMAA PNG marker.static java.lang.StringiCCPA PNG marker.static java.lang.StringIDATA PNG marker.static java.lang.StringIENDA PNG marker.static java.lang.StringIHDRA PNG marker.private static java.lang.String[]intentsstatic java.lang.StringpHYsA PNG marker.static java.lang.StringPLTEA PNG marker.private static intPNG_FILTER_AVERAGEprivate static intPNG_FILTER_NONEprivate static intPNG_FILTER_PAETHprivate static intPNG_FILTER_SUBprivate static intPNG_FILTER_UPstatic int[]PNGIDSome PNG specific values.static java.lang.StringsRGBA PNG marker.private static intTRANSFERSIZEstatic java.lang.StringtRNSA PNG marker.
-
Constructor Summary
Constructors Constructor Description PngImageHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static booleancheckMarker(java.lang.String s)private static voiddecodeAverageFilter(byte[] curr, byte[] prev, int count, int bpp)private static voiddecodeIdat(PngImageHelper.PngParameters png)private 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 intgetExpectedNumberOfColorComponents(PngImageHelper.PngParameters png)static intgetInt(java.io.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 java.lang.StringgetString(java.io.InputStream pngStream)Gets aStringfrom anInputStream.static intgetWord(java.io.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(java.io.InputStream pngStream, PngImageHelper.PngParameters png)private static voidreadPng(java.io.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 Detail
-
PNGID
public static final int[] PNGID
Some PNG specific values.
-
IHDR
public static final java.lang.String IHDR
A PNG marker.- See Also:
- Constant Field Values
-
PLTE
public static final java.lang.String PLTE
A PNG marker.- See Also:
- Constant Field Values
-
IDAT
public static final java.lang.String IDAT
A PNG marker.- See Also:
- Constant Field Values
-
IEND
public static final java.lang.String IEND
A PNG marker.- See Also:
- Constant Field Values
-
tRNS
public static final java.lang.String tRNS
A PNG marker.- See Also:
- Constant Field Values
-
pHYs
public static final java.lang.String pHYs
A PNG marker.- See Also:
- Constant Field Values
-
gAMA
public static final java.lang.String gAMA
A PNG marker.- See Also:
- Constant Field Values
-
cHRM
public static final java.lang.String cHRM
A PNG marker.- See Also:
- Constant Field Values
-
sRGB
public static final java.lang.String sRGB
A PNG marker.- See Also:
- Constant Field Values
-
iCCP
public static final java.lang.String iCCP
A PNG marker.- See Also:
- Constant Field Values
-
TRANSFERSIZE
private static final int TRANSFERSIZE
- See Also:
- Constant Field Values
-
PNG_FILTER_NONE
private static final int PNG_FILTER_NONE
- See Also:
- Constant Field Values
-
PNG_FILTER_SUB
private static final int PNG_FILTER_SUB
- See Also:
- Constant Field Values
-
PNG_FILTER_UP
private static final int PNG_FILTER_UP
- See Also:
- Constant Field Values
-
PNG_FILTER_AVERAGE
private static final int PNG_FILTER_AVERAGE
- See Also:
- Constant Field Values
-
PNG_FILTER_PAETH
private static final int PNG_FILTER_PAETH
- See Also:
- Constant Field Values
-
intents
private static final java.lang.String[] intents
-
-
Method Detail
-
processImage
public static void processImage(ImageData image)
-
processPng
private static void processPng(java.io.InputStream pngStream, PngImageHelper.PngParameters png) throws java.io.IOException- Throws:
java.io.IOException
-
getExpectedNumberOfColorComponents
private static int getExpectedNumberOfColorComponents(PngImageHelper.PngParameters png)
-
readPng
private static void readPng(java.io.InputStream pngStream, PngImageHelper.PngParameters png) throws java.io.IOException- Throws:
java.io.IOException
-
checkMarker
private static boolean checkMarker(java.lang.String s)
-
decodeIdat
private static void decodeIdat(PngImageHelper.PngParameters png)
-
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
private static int[] getPixel(byte[] curr, PngImageHelper.PngParameters png)
-
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
public static int getInt(java.io.InputStream pngStream) throws java.io.IOExceptionGets anintfrom anInputStream.- Parameters:
pngStream- anInputStream- Returns:
- the value of an
int - Throws:
java.io.IOException
-
getWord
public static int getWord(java.io.InputStream pngStream) throws java.io.IOExceptionGets awordfrom anInputStream.- Parameters:
pngStream- anInputStream- Returns:
- the value of an
int - Throws:
java.io.IOException
-
getString
public static java.lang.String getString(java.io.InputStream pngStream) throws java.io.IOExceptionGets aStringfrom anInputStream.- Parameters:
pngStream- anInputStream- Returns:
- the value of an
int - Throws:
java.io.IOException
-
-