Class PngWriter
java.lang.Object
org.apache.commons.imaging.formats.png.PngWriter
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate byte[]deflate(byte[] bytes) private bytegetBitDepth(PngColorType pngColorType, PngImagingParameters params) private booleanprivate voidwriteChunk(OutputStream os, ChunkType chunkType, byte[] data) private voidwriteChunkIDAT(OutputStream os, byte[] bytes) private voidprivate voidwriteChunkIHDR(OutputStream os, PngWriter.ImageHeader value) private voidwriteChunkiTXt(OutputStream os, AbstractPngText.Itxt text) private voidwriteChunkPHYS(OutputStream os, int xPPU, int yPPU, byte units) private voidwriteChunkPLTE(OutputStream os, Palette palette) private voidwriteChunkSCAL(OutputStream os, double xUPP, double yUPP, byte units) private voidwriteChunktEXt(OutputStream os, AbstractPngText.Text text) private voidwriteChunkTRNS(OutputStream os, Palette palette) private voidwriteChunkXmpiTXt(OutputStream os, String xmpXml) private voidwriteChunkzTXt(OutputStream os, AbstractPngText.Ztxt text) voidwriteImage(BufferedImage src, OutputStream os, PngImagingParameters params, PaletteFactory paletteFactory) Writes an image to an output stream.private voidwriteInt(OutputStream os, int value)
-
Constructor Details
-
PngWriter
public PngWriter()
-
-
Method Details
-
deflate
- Throws:
IOException
-
getBitDepth
-
isValidISO_8859_1
-
writeChunk
- Throws:
IOException
-
writeChunkIDAT
- Throws:
IOException
-
writeChunkIEND
- Throws:
IOException
-
writeChunkIHDR
- Throws:
IOException
-
writeChunkiTXt
private void writeChunkiTXt(OutputStream os, AbstractPngText.Itxt text) throws IOException, ImagingException - Throws:
IOExceptionImagingException
-
writeChunkPHYS
- Throws:
IOException
-
writeChunkPLTE
- Throws:
IOException
-
writeChunkSCAL
private void writeChunkSCAL(OutputStream os, double xUPP, double yUPP, byte units) throws IOException - Throws:
IOException
-
writeChunktEXt
private void writeChunktEXt(OutputStream os, AbstractPngText.Text text) throws IOException, ImagingException - Throws:
IOExceptionImagingException
-
writeChunkTRNS
- Throws:
IOException
-
writeChunkXmpiTXt
- Throws:
IOException
-
writeChunkzTXt
private void writeChunkzTXt(OutputStream os, AbstractPngText.Ztxt text) throws IOException, ImagingException - Throws:
IOExceptionImagingException
-
writeImage
public void writeImage(BufferedImage src, OutputStream os, PngImagingParameters params, PaletteFactory paletteFactory) throws ImagingException, IOException Writes an image to an output stream.- Parameters:
src- The image to write.os- The output stream to write to.params- The parameters to use (can beNULLto use the defaultPngImagingParameters).paletteFactory- The palette factory to use (can beNULLto use the defaultPaletteFactory).- Throws:
ImagingException- When errors are detected.IOException- When IO problems occur.
-
writeInt
- Throws:
IOException
-