Package com.itextpdf.text.pdf.codec
Class PngWriter
- java.lang.Object
-
- com.itextpdf.text.pdf.codec.PngWriter
-
public class PngWriter extends java.lang.Object
Writes a PNG image.- Since:
- 5.0.3
-
-
Constructor Summary
Constructors Constructor Description PngWriter(java.io.OutputStream outp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
crc(byte[] buf)
private static int
crc(byte[] buf, int offset, int len)
private static void
make_crc_table()
void
outputInt(int n)
static void
outputInt(int n, java.io.OutputStream s)
private static int
update_crc(int crc, byte[] buf, int offset, int len)
void
writeChunk(byte[] chunkType, byte[] data)
void
writeData(byte[] data, int stride)
void
writeEnd()
void
writeHeader(int width, int height, int bitDepth, int colorType)
void
writeIccProfile(byte[] data)
void
writePalette(byte[] data)
-
-
-
Field Detail
-
PNG_SIGNTURE
private static final byte[] PNG_SIGNTURE
-
IHDR
private static final byte[] IHDR
-
PLTE
private static final byte[] PLTE
-
IDAT
private static final byte[] IDAT
-
IEND
private static final byte[] IEND
-
iCCP
private static final byte[] iCCP
-
crc_table
private static int[] crc_table
-
outp
private java.io.OutputStream outp
-
-
Method Detail
-
writeHeader
public void writeHeader(int width, int height, int bitDepth, int colorType) throws java.io.IOException
- Throws:
java.io.IOException
-
writeEnd
public void writeEnd() throws java.io.IOException
- Throws:
java.io.IOException
-
writeData
public void writeData(byte[] data, int stride) throws java.io.IOException
- Throws:
java.io.IOException
-
writePalette
public void writePalette(byte[] data) throws java.io.IOException
- Throws:
java.io.IOException
-
writeIccProfile
public void writeIccProfile(byte[] data) throws java.io.IOException
- Throws:
java.io.IOException
-
make_crc_table
private static void make_crc_table()
-
update_crc
private static int update_crc(int crc, byte[] buf, int offset, int len)
-
crc
private static int crc(byte[] buf, int offset, int len)
-
crc
private static int crc(byte[] buf)
-
outputInt
public void outputInt(int n) throws java.io.IOException
- Throws:
java.io.IOException
-
outputInt
public static void outputInt(int n, java.io.OutputStream s) throws java.io.IOException
- Throws:
java.io.IOException
-
writeChunk
public void writeChunk(byte[] chunkType, byte[] data) throws java.io.IOException
- Throws:
java.io.IOException
-
-