Class PngWriter

java.lang.Object
com.itextpdf.text.pdf.codec.PngWriter

public class PngWriter extends Object
Writes a PNG image.
Since:
5.0.3
  • Field Details

    • 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 OutputStream outp
  • Constructor Details

  • Method Details

    • writeHeader

      public void writeHeader(int width, int height, int bitDepth, int colorType) throws IOException
      Throws:
      IOException
    • writeEnd

      public void writeEnd() throws IOException
      Throws:
      IOException
    • writeData

      public void writeData(byte[] data, int stride) throws IOException
      Throws:
      IOException
    • writePalette

      public void writePalette(byte[] data) throws IOException
      Throws:
      IOException
    • writeIccProfile

      public void writeIccProfile(byte[] data) throws IOException
      Throws:
      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 IOException
      Throws:
      IOException
    • outputInt

      public static void outputInt(int n, OutputStream s) throws IOException
      Throws:
      IOException
    • writeChunk

      public void writeChunk(byte[] chunkType, byte[] data) throws IOException
      Throws:
      IOException