Class PngChunkType

java.lang.Object
com.drew.imaging.png.PngChunkType

public class PngChunkType extends Object
Author:
Drew Noakes https://drewnoakes.com
  • Field Details

    • IHDR

      public static final PngChunkType IHDR
      Denotes a critical PngChunk that contains basic information about the PNG image. This must be the first chunk in the data sequence, and may only occur once.

      The format is:

      • pixel width 4 bytes, unsigned and greater than zero
      • pixel height 4 bytes, unsigned and greater than zero
      • bit depth 1 byte, number of bits per sample or per palette index (not per pixel)
      • color type 1 byte, maps to PngColorType enum
      • compression method 1 byte, currently only a value of zero (deflate/inflate) is in the standard
      • filter method 1 byte, currently only a value of zero (adaptive filtering with five basic filter types) is in the standard
      • interlace method 1 byte, indicates the transmission order of image data, currently only 0 (no interlace) and 1 (Adam7 interlace) are in the standard
    • PLTE

      public static final PngChunkType PLTE
      Denotes a critical PngChunk that contains palette entries. This chunk should only appear for a PngColorType of IndexedColor, and may only occur once in the PNG data sequence.

      The chunk contains between one and 256 entries, each of three bytes:

      • red 1 byte
      • green 1 byte
      • blue 1 byte
      The number of entries is determined by the chunk length. A chunk length indivisible by three is an error.
    • IDAT

      public static final PngChunkType IDAT
    • IEND

      public static final PngChunkType IEND
    • cHRM

      public static final PngChunkType cHRM
    • gAMA

      public static final PngChunkType gAMA
    • iCCP

      public static final PngChunkType iCCP
    • sBIT

      public static final PngChunkType sBIT
    • sRGB

      public static final PngChunkType sRGB
    • bKGD

      public static final PngChunkType bKGD
    • hIST

      public static final PngChunkType hIST
    • tRNS

      public static final PngChunkType tRNS
    • pHYs

      public static final PngChunkType pHYs
    • sPLT

      public static final PngChunkType sPLT
    • tIME

      public static final PngChunkType tIME
    • iTXt

      public static final PngChunkType iTXt
    • eXIf

      public static final PngChunkType eXIf
    • tEXt

      public static final PngChunkType tEXt
      Denotes an ancillary PngChunk that contains textual data, having first a keyword and then a value. If multiple text data keywords are needed, then multiple chunks are included in the PNG data stream.

      The format is:

      • keyword 1-79 bytes
      • null separator 1 byte (\0)
      • text string 0 or more bytes
      Text is interpreted according to the Latin-1 character set [ISO-8859-1]. Newlines should be represented by a single linefeed character (0x9).
    • zTXt

      public static final PngChunkType zTXt
  • Constructor Details

  • Method Details

    • isCritical

      public boolean isCritical()
    • isAncillary

      public boolean isAncillary()
    • isPrivate

      public boolean isPrivate()
    • isSafeToCopy

      public boolean isSafeToCopy()
    • areMultipleAllowed

      public boolean areMultipleAllowed()
    • getIdentifier

      public String getIdentifier()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object